From: Frank Brehm Date: Mon, 29 Oct 2018 14:20:33 +0000 (+0100) Subject: Retreiving VM after creation X-Git-Tag: 0.3.2^2~19 X-Git-Url: https://git.uhu-banane.org/?a=commitdiff_plain;h=f72a4827451955ae446530d69e9b668f31d8ba2e;p=pixelpark%2Fcreate-vmware-tpl.git Retreiving VM after creation --- diff --git a/lib/cr_vmware_tpl/handler.py b/lib/cr_vmware_tpl/handler.py index e352149..18a43b0 100644 --- a/lib/cr_vmware_tpl/handler.py +++ b/lib/cr_vmware_tpl/handler.py @@ -43,7 +43,7 @@ from fb_tools.vsphere.iface import VsphereVmInterface from .config import CrTplConfiguration -__version__ = '0.10.7' +__version__ = '0.10.8' LOG = logging.getLogger(__name__) TZ = pytz.timezone('Europe/Berlin') @@ -171,6 +171,12 @@ class CrTplHandler(BaseHandler): LOG.warn("Only executing of template rotating.") else: self.create_vm() + self.tpl_vm = self.vsphere.get_vm(self.config.template_vm, as_vmw_obj=True) + if not self.tpl_vm: + if self.simulate: + LOG.warn("Simulation mode - VM not created in real.") + else: + raise HandlerError("Could not find VM after creating.") return 0 @@ -201,10 +207,10 @@ class CrTplHandler(BaseHandler): else: # self.check_network() # self.create_vm() - self.tpl_vm = self.get_temp_tpl_vm() - if not self.tpl_vm: - raise HandlerError( - "Could not find VM after creating.") +# self.tpl_vm = self.get_temp_tpl_vm() +# if not self.tpl_vm: +# raise HandlerError( +# "Could not find VM after creating.") self.poweron_vm() self.wait_for_finish_install() self.get_postinstall_error() diff --git a/python_fb_tools b/python_fb_tools index 054826f..d4c4790 160000 --- a/python_fb_tools +++ b/python_fb_tools @@ -1 +1 @@ -Subproject commit 054826f57a21a2a29fb19609d4192383844528a6 +Subproject commit d4c4790f6abbcd7339d5ce4734c0a4d3129e1441