From: Frank Brehm Date: Wed, 27 May 2020 14:48:33 +0000 (+0200) Subject: Parsing for Cobbler version X-Git-Tag: 2.1.2^2~9^2~31^2~108 X-Git-Url: https://git.uhu-banane.net/?a=commitdiff_plain;h=268cc90d2ffbfed6253c36d5abd0d243699e6a65;p=pixelpark%2Fcreate-vmware-tpl.git Parsing for Cobbler version --- diff --git a/lib/cr_vmware_tpl/cobbler.py b/lib/cr_vmware_tpl/cobbler.py index 0af1df2..b4938d1 100644 --- a/lib/cr_vmware_tpl/cobbler.py +++ b/lib/cr_vmware_tpl/cobbler.py @@ -31,7 +31,7 @@ from .config import CrTplConfiguration from .xlate import XLATOR -__version__ = '0.2.2' +__version__ = '0.2.3' LOG = logging.getLogger(__name__) @@ -159,8 +159,9 @@ class Cobbler(BaseHandler): proc = self.exec_cobbler('version', no_simulate=True) - cobbler_version = proc.stdout - LOG.info(_("Version of {} is:").format("Cobbler") + "\n{}".format(cobbler_version)) + first_line = proc.stdout.splitlines()[0] + cobbler_version = re.sub(r'^\s*cobbler\s+', '', first_line, re.IGNORECASE).strip() + LOG.info(_("Version of {} is:").format("Cobbler") + " {!r}".format(cobbler_version)) return cobbler_version