From f72a4827451955ae446530d69e9b668f31d8ba2e Mon Sep 17 00:00:00 2001 From: Frank Brehm Date: Mon, 29 Oct 2018 15:20:33 +0100 Subject: [PATCH] Retreiving VM after creation --- lib/cr_vmware_tpl/handler.py | 16 +++++++++++----- python_fb_tools | 2 +- 2 files changed, 12 insertions(+), 6 deletions(-) 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 -- 2.39.5