from .xlate import XLATOR
-__version__ = '0.3.8'
+__version__ = '0.3.9'
LOG = logging.getLogger(__name__)
cobbler_version = re.sub(r'^\s*cobbler\s+', '', first_line, flags=re.IGNORECASE).strip()
LOG.info(_("Version of {} is:").format("Cobbler") + " {!r}".format(cobbler_version))
- rdir = self.config.cobbler_rootdir
+ self.check_remote_directory(self.config.cobbler_rootdir, _('Cobbler root directory'))
+
+ return cobbler_version
+
+ # -------------------------------------------------------------------------
+ def check_remote_directory(self, rdir, desc=None):
+
if self.verbose > 1:
msg = _("Checking existence of remote directory {!r} ...").format(str(rdir))
LOG.debug(msg)
proc = self.exec_ssh(cmd)
if proc.returncode != 0:
+ dsc = _('Remote directory')
+ if desc:
+ dsc = desc
msg = _(
- "Cobbler root directory {rdir!r} on host {host!r} does not "
- "exists or is not a directory.").format(rdir=str(rdir), host=self.host)
+ "{dsc} {rdir!r} on host {host!r} does not exists or is not a directory.").format(
+ dsc=dsc, rdir=str(rdir), host=self.host)
raise ExpectedCobblerError(msg)
- return cobbler_version
+
# -------------------------------------------------------------------------
def get_distro_list(self):