from .xlate import XLATOR
-__version__ = '0.8.1'
+__version__ = '0.8.2'
LOG = logging.getLogger(__name__)
LOG.debug(_("Sorted list of found distros:") + "\n{}".format(pp(distro_list)))
return distro_list
+ # -------------------------------------------------------------------------
+ def get_repo_list(self):
+ """Trying to get a list of all configured repositories."""
+
+ repo_list = []
+
+ proc = self.exec_cobbler(('repo', 'list'), no_simulate=True)
+ for line in proc.stdout.splitlines():
+ repo = line.strip()
+ if repo:
+ repo_list.append(repo)
+ repo_list.sort(key=str.lower)
+ if self.verbose > 1:
+ LOG.debug(_("Sorted list of found repositories:") + "\n{}".format(pp(repo_list)))
+ return repo_list
+
+ # -------------------------------------------------------------------------
+ def verify_distro_repos(self, distro):
+
+ repo_list = self.get_repo_list()
+
+ LOG.debug(_("Checking existence of repos for distro {!r}.").format(distro.name))
+
+ all_ok = True
+ for repo in distro.repos:
+ if repo not in repo_list:
+ msg = _("Repo {r!r} for distro {d!r} not found on cobbler server.").format(
+ r=repo, d=distro.name)
+ LOG.warn(msg)
+ all_ok = False
+ elif self.verbose > 1:
+ msg = _("Found repo {r!r} for distro {d!r}.").format(r=repo, d=distro.name)
+ LOG.debug(msg)
+
+ return all_ok
+
# -------------------------------------------------------------------------
def get_profile_list(self):
"""Trying to get a list of all configured cobbler profiles."""
from .xlate import XLATOR
-__version__ = '2.1.0'
+__version__ = '2.1.1'
LOG = logging.getLogger(__name__)
TZ = pytz.timezone('Europe/Berlin')
self.cfg.cobbler_distro)
LOG.debug(msg)
+ if not self.cobbler.verify_distro_repos(self.cfg.current_distro):
+ msg = _("Not all rpos for distro {!r} were found on Cobbler server.").format(
+ self.cfg.current_distro.name)
+ raise ExpectedHandlerError(msg)
+
# -------------------------------------------------------------------------
def check_for_temp_tpl_vm(self, no_error=False):