]> Frank Brehm's Git Trees - pixelpark/create-vmware-tpl.git/commitdiff
Minor changes on creating Cobbler system
authorFrank Brehm <frank.brehm@pixelpark.com>
Tue, 9 Jun 2020 15:48:24 +0000 (17:48 +0200)
committerFrank Brehm <frank.brehm@pixelpark.com>
Tue, 9 Jun 2020 15:48:24 +0000 (17:48 +0200)
lib/cr_vmware_tpl/handler.py

index f9f16861a4dd69d498fca6495328f6328f1750ad..ea03527c19cc069bfe7c6b5bd177b52c524d155c 100644 (file)
@@ -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()