]> Frank Brehm's Git Trees - pixelpark/create-vmware-tpl.git/commitdiff
Bugfixing
authorFrank Brehm <frank.brehm@pixelpark.com>
Tue, 9 Jun 2020 13:05:20 +0000 (15:05 +0200)
committerFrank Brehm <frank.brehm@pixelpark.com>
Tue, 9 Jun 2020 13:05:20 +0000 (15:05 +0200)
lib/cr_vmware_tpl/config.py
lib/cr_vmware_tpl/handler.py

index eea20fb0223c8f7d86fb0b5dbca73215db833334..9e963336d18da2d818f894c6be7e7d30a82d0ed1 100644 (file)
@@ -21,7 +21,7 @@ from fb_tools.config import ConfigError, BaseConfiguration
 
 from .xlate import XLATOR
 
-__version__ = '1.5.1'
+__version__ = '1.5.2'
 LOG = logging.getLogger(__name__)
 
 _ = XLATOR.gettext
index e0af74e2819542a4a6b938a06226efe5f4c8b692..3649017ef606ff0ebf55af85c316840fb22a9701 100644 (file)
@@ -42,7 +42,7 @@ from .cobbler import CobblerError, Cobbler
 
 from .xlate import XLATOR
 
-__version__ = '1.5.4'
+__version__ = '1.5.5'
 
 LOG = logging.getLogger(__name__)
 TZ = pytz.timezone('Europe/Berlin')
@@ -254,15 +254,16 @@ class CrTplHandler(BaseHandler):
             self.create_vm()
             self.tpl_vm = self.vsphere.get_vm(self.tpl_vm_fqdn, as_vmw_obj=True)
             if self.tpl_vm:
-                 LOG.debug(_("Created VM as {cls}: {vm!r}").format(
-                     cls=self.tpl_vm.__class__.__name__, vm=self.tpl_vm))
-                 for device in self.tpl_vm.config.hardware.device:
-                     if isinstance(device, vim.vm.device.VirtualEthernetCard):
-                         self.tpl_macaddress = device.macAddress
-                         LOG.debug(_("Found Ethernet card as {}.").format(
+                LOG.debug(_("Created VM as {cls}: {vm!r}").format(
+                    cls=self.tpl_vm.__class__.__name__, vm=self.tpl_vm))
+                for device in self.tpl_vm.config.hardware.device:
+                    if isinstance(device, vim.vm.device.VirtualEthernetCard):
+                        self.tpl_macaddress = device.macAddress
+                        LOG.debug(_("Found Ethernet card as {}.").format(
                             device.__class__.__name__))
-                         if self.verbose > 2:
+                        if self.verbose > 2:
                             LOG.debug(_("Found Ethernet card:") + "\n{}".format(device))
+                        break
                 if not self.tpl_macaddress:
                     msg = _("Did not found MAC address of ethernet card.")
                     raise HandlerError(msg)