]> Frank Brehm's Git Trees - pixelpark/create-vmware-tpl.git/commitdiff
Retreiving VM after creation
authorFrank Brehm <frank.brehm@pixelpark.com>
Mon, 29 Oct 2018 14:20:33 +0000 (15:20 +0100)
committerFrank Brehm <frank.brehm@pixelpark.com>
Mon, 29 Oct 2018 14:20:33 +0000 (15:20 +0100)
lib/cr_vmware_tpl/handler.py
python_fb_tools

index e352149000b995931dca4035341c4f9de9c5fa9d..18a43b099e1efb2f0cdc7027c26ee7e0288ee98c 100644 (file)
@@ -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()
index 054826f57a21a2a29fb19609d4192383844528a6..d4c4790f6abbcd7339d5ce4734c0a4d3129e1441 160000 (submodule)
@@ -1 +1 @@
-Subproject commit 054826f57a21a2a29fb19609d4192383844528a6
+Subproject commit d4c4790f6abbcd7339d5ce4734c0a4d3129e1441