]> Frank Brehm's Git Trees - pixelpark/create-terraform.git/commitdiff
Getting VMWare/VSPhere objects now from package fb_vmware
authorFrank Brehm <frank@brehm-online.com>
Tue, 19 Jul 2022 10:23:26 +0000 (12:23 +0200)
committerFrank Brehm <frank@brehm-online.com>
Tue, 19 Jul 2022 10:23:26 +0000 (12:23 +0200)
lib/cr_tf/handler.py
requirements.txt

index 5309e4609f07a2342c52cf1775cef8c72b35dc5a..05d5ab4d485ac4415a7ef57c5221ecf7bb50f863 100644 (file)
@@ -42,16 +42,12 @@ import six
 
 # Own modules
 from fb_tools.common import pp, to_bool, to_str, RE_DOT_AT_END
-
 from fb_tools.errors import HandlerError, ExpectedHandlerError, CommandNotFoundError
-
 from fb_tools.handling_obj import HandlingObject, CalledProcessError
-
 from fb_tools.handler import BaseHandler
 
-from fb_tools.vsphere.server import VsphereServer
-
-from fb_tools.vsphere.errors import VSphereExpectedError
+from fb_vmware.errors import VSphereExpectedError
+from fb_vmware.connect import VsphereConnection
 
 from fb_pdnstools.server import PowerDNSServer
 from fb_pdnstools.errors import PowerDNSHandlerError
@@ -787,11 +783,11 @@ class CreateTerraformHandler(BaseHandler):
                     params_out = copy.copy(params)
                     if self.verbose < 5:
                         params_out['password'] = '******'
-                    msg = _("Initialising a {}-object with params:").format('VsphereServer')
+                    msg = _("Initialising a {}-object with params:").format('VsphereConnection')
                     msg += '\n' + pp(params_out)
                     LOG.debug(msg)
 
-                vsphere = VsphereServer(**params)
+                vsphere = VsphereConnection(**params)
                 self.vsphere[vname] = vsphere
 
             except VSphereExpectedError as e:
@@ -811,7 +807,7 @@ class CreateTerraformHandler(BaseHandler):
 
                 vsphere.get_about()
                 if self.verbose > 2:
-                    msg = _("Created {}-object:").format('VsphereServer')
+                    msg = _("Created {}-object:").format('VsphereConnection')
                     msg += '\n' + pp(vsphere.as_dict())
                     LOG.debug(msg)
 
index 134e63937e4d812dfa1ed992d50824de3b02278b..7d15fd3c58f97f8b83f93dd724dae2f7ae7d9fb7 100644 (file)
@@ -12,3 +12,4 @@ setuptools
 fb_logging
 fb_tools
 fb_pdnstools
+fb_vmware