From: Frank Brehm Date: Thu, 11 Jun 2020 11:53:32 +0000 (+0200) Subject: Completing creating a cobbler system X-Git-Tag: 2.1.2^2~9^2~31^2~58 X-Git-Url: https://git.uhu-banane.org/?a=commitdiff_plain;h=32458fab9137c30426358ed2f61f45308cb22ba1;p=pixelpark%2Fcreate-vmware-tpl.git Completing creating a cobbler system --- diff --git a/lib/cr_vmware_tpl/cobbler.py b/lib/cr_vmware_tpl/cobbler.py index cd53411..3e749b5 100644 --- a/lib/cr_vmware_tpl/cobbler.py +++ b/lib/cr_vmware_tpl/cobbler.py @@ -37,7 +37,7 @@ from .config import CrTplConfiguration from .xlate import XLATOR -__version__ = '0.4.7' +__version__ = '0.4.8' LOG = logging.getLogger(__name__) @@ -664,12 +664,36 @@ class Cobbler(BaseHandler): if ks_meta: args.append('--ksmeta') args.append(ks_meta) + args.append('--kickstart') + args.append(str(self.config.system_ks)) + args.append('--power-type') + args.append('apc') + args.append('--hostname') + args.append(fqdn) + args.append('--mac-address') + args.append(mac_address) + args.append('--interface') + args.append('eth0') + args.append('--management') + args.append('true') cmd_str = 'cobbler ' + ' '.join(map(lambda x: pipes.quote(x), args)) LOG.debug("Should execute: {}".format(cmd_str)) if self.verbose > 1: LOG.debug(_("Cobbler arguments for creating a new system:") + "\n" + pp(args)) + proc = self.exec_cobbler(args) + + if proc.returncode: + err = _('No error message') + if proc.stderr: + err = proc.stderr + elif proc.stdout: + err = proc.stdout + msg = _("Error creating a cobbler system - returncode was {rc}: {err}").format( + rc=proc.returncode, err=err) + raise ExpectedCobblerError(msg) + # ============================================================================= if __name__ == "__main__":