From: Frank Brehm Date: Tue, 9 Jun 2020 13:05:20 +0000 (+0200) Subject: Bugfixing X-Git-Tag: 2.1.2^2~9^2~31^2~69 X-Git-Url: https://git.uhu-banane.net/?a=commitdiff_plain;h=c53902005d1b23ef5bc303d3180e04c135bc056e;p=pixelpark%2Fcreate-vmware-tpl.git Bugfixing --- diff --git a/lib/cr_vmware_tpl/config.py b/lib/cr_vmware_tpl/config.py index eea20fb..9e96333 100644 --- a/lib/cr_vmware_tpl/config.py +++ b/lib/cr_vmware_tpl/config.py @@ -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 diff --git a/lib/cr_vmware_tpl/handler.py b/lib/cr_vmware_tpl/handler.py index e0af74e..3649017 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.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)