]> Frank Brehm's Git Trees - pixelpark/create-vmware-tpl.git/commitdiff
First actions with VSphere
authorFrank Brehm <frank.brehm@pixelpark.com>
Wed, 24 Oct 2018 09:34:52 +0000 (11:34 +0200)
committerFrank Brehm <frank.brehm@pixelpark.com>
Wed, 24 Oct 2018 09:34:52 +0000 (11:34 +0200)
bin/create-vmware-template
lib/cr_vmware_tpl/app.py
lib/cr_vmware_tpl/handler.py
python_fb_tools

index 38e7507ca2a237f4f4a3c50265c870ca5d19ccc1..63745de486ba9161b593942dd74e67d04b063cb8 100755 (executable)
@@ -52,7 +52,7 @@ app.initialized = True
 if app.verbose > 2:
     print("{c}-Object:\n{a}".format(c=app.__class__.__name__, a=app))
 
-app()
+app()
 
 sys.exit(0)
 
index e40a050e796c7bd1646f06f459228be79107f889..9171d18578e81a00b4fed3c6509bb0fe39852c01 100644 (file)
@@ -391,12 +391,12 @@ class CrTplApplication(BaseApplication):
         LOG.info("Starting {a!r}, version {v!r} ...".format(
             a=self.appname, v=self.version))
 
-#        try:
-#            ret = self.handler()
-#            self.exit(ret)
-#        except ExpectedHandlerError as e:
-#            self.handle_error(str(e), "Temporary VM")
-#            self.exit(5)
+        try:
+            ret = self.handler()
+            self.exit(ret)
+        except ExpectedHandlerError as e:
+            self.handle_error(str(e), "Temporary VM")
+            self.exit(5)
 
 
 # =============================================================================
index 266fbda4c4727fe490df5c6b7ff569b08c8d371c..1af36312482df27a0d1b7ce68e82a78193c2a438 100644 (file)
@@ -131,8 +131,24 @@ class CrTplHandler(BaseHandler):
                 "self.config is not a CrTplConfiguration-instance, but a "
                 "{}-instance instead.").format(self.config.__class__.__name__))
 
+        retval = 0
+        try:
+            retval = self.run()
+        finally:
+            LOG.debug("Closing ...")
+            self.vsphere.disconnect()
+            self.vsphere = None
 
-        return
+        return retval
+
+    # -------------------------------------------------------------------------
+    def run(self):
+
+        LOG.debug("Starting handling ...")
+
+        self.vsphere.get_about()
+
+        return 0
 
 
         LOG.debug("Connecting to vSphere host {h}:{p} as {u!r} ...".format(
index d542794caaf1b5336ad451901cbb0b9e6d58b6b2..ff5009c6121ba6918b3f57f235bbd41091e6710d 160000 (submodule)
@@ -1 +1 @@
-Subproject commit d542794caaf1b5336ad451901cbb0b9e6d58b6b2
+Subproject commit ff5009c6121ba6918b3f57f235bbd41091e6710d