]> Frank Brehm's Git Trees - pixelpark/create-vmware-tpl.git/commitdiff
Made cluster to a property of the CrTplHandler class
authorFrank Brehm <frank.brehm@pixelpark.com>
Wed, 24 Oct 2018 10:44:23 +0000 (12:44 +0200)
committerFrank Brehm <frank.brehm@pixelpark.com>
Wed, 24 Oct 2018 10:44:23 +0000 (12:44 +0200)
lib/cr_vmware_tpl/handler.py
python_fb_tools

index 2c7598e8afaab82b94f75a265fd97e0cecb348cc..399c670cb52e52aed85e382c5d61fc0332fd1b72 100644 (file)
@@ -114,6 +114,7 @@ class CrTplHandler(BaseHandler):
             dc=self.config.dc, cluster=self.config.vsphere_cluster,
             auto_close=True, simulate=self.simulate, force=self.force,
             terminal_has_colors=self.terminal_has_colors, initialized=False)
+        self.cluster = None
 
         if initialized:
             self.initialized = True
@@ -135,6 +136,8 @@ class CrTplHandler(BaseHandler):
         try:
             retval = self.run()
         finally:
+            # Aufräumen ...
+            self.cluster = None
             LOG.debug("Closing ...")
             self.vsphere.disconnect()
             self.vsphere = None
@@ -148,9 +151,9 @@ class CrTplHandler(BaseHandler):
 
         self.vsphere.get_about()
         self.vsphere.get_clusters()
-        cluster = self.vsphere.get_cluster_by_name(self.config.vsphere_cluster)
-        if cluster:
-            LOG.debug("Found VSphere cluster {!r}.".format(cluster.name))
+        self.cluster = self.vsphere.get_cluster_by_name(self.config.vsphere_cluster)
+        if self.cluster:
+            LOG.debug("Found VSphere cluster {!r}.".format(self.cluster.name))
         else:
             LOG.error("Could not find VSphere cluster {!r}.".format(self.config.vsphere_cluster))
             return 6
index 01981d48e153607edd4f4d17e1388cc4b8419fa7..1a34235b15900c1fdeb5e3550c820ccfe2c16455 160000 (submodule)
@@ -1 +1 @@
-Subproject commit 01981d48e153607edd4f4d17e1388cc4b8419fa7
+Subproject commit 1a34235b15900c1fdeb5e3550c820ccfe2c16455