From: Frank Brehm Date: Tue, 9 Jun 2020 15:48:24 +0000 (+0200) Subject: Minor changes on creating Cobbler system X-Git-Tag: 2.1.2^2~9^2~31^2~67 X-Git-Url: https://git.uhu-banane.org/?a=commitdiff_plain;h=15e58a262607b3646d8da4ac8481c2c934229785;p=pixelpark%2Fcreate-vmware-tpl.git Minor changes on creating Cobbler system --- 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()