From 15e58a262607b3646d8da4ac8481c2c934229785 Mon Sep 17 00:00:00 2001 From: Frank Brehm Date: Tue, 9 Jun 2020 17:48:24 +0200 Subject: [PATCH] Minor changes on creating Cobbler system --- lib/cr_vmware_tpl/handler.py | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/lib/cr_vmware_tpl/handler.py b/lib/cr_vmware_tpl/handler.py index f9f1686..ea03527 100644 --- a/lib/cr_vmware_tpl/handler.py +++ b/lib/cr_vmware_tpl/handler.py @@ -42,7 +42,7 @@ from .cobbler import CobblerError, Cobbler from .xlate import XLATOR -__version__ = '1.5.6' +__version__ = '1.5.7' LOG = logging.getLogger(__name__) TZ = pytz.timezone('Europe/Berlin') @@ -276,8 +276,13 @@ class CrTplHandler(BaseHandler): LOG.info(_("Using MAC address of template VM: {!r}").format(self.tpl_macaddress)) + tpl_sysname = 'template-' + self.tpl_vm_hostname + status = 'development' + if self.config.vsphere_host == 'vcs01.ppbrln.internal': + status = 'production' self.cobbler.add_system( - name=self.tpl_vm_hostname, fqdn=self.tpl_vm_fqdn, mac_address=self.tpl_macaddress) + name=tpl_sysname, fqdn=self.tpl_vm_fqdn, mac_address=self.tpl_macaddress, + status=status) # self.vsphere.poweron_vm(self.tpl_vm, max_wait=self.config.max_wait_for_poweron_vm) # self.ts_start_install = time.time() -- 2.39.5