From 644c7b038fc3b134ee84ea4bc87208aa17a6a7b6 Mon Sep 17 00:00:00 2001 From: Frank Brehm Date: Tue, 23 Oct 2018 17:39:56 +0200 Subject: [PATCH] Integrating vsphere modules --- lib/cr_vmware_tpl/app.py | 4 ++-- lib/cr_vmware_tpl/handler.py | 15 +++++++++++++++ python_fb_tools | 2 +- 3 files changed, 18 insertions(+), 3 deletions(-) diff --git a/lib/cr_vmware_tpl/app.py b/lib/cr_vmware_tpl/app.py index cd3286b..e40a050 100644 --- a/lib/cr_vmware_tpl/app.py +++ b/lib/cr_vmware_tpl/app.py @@ -248,14 +248,14 @@ class CrTplApplication(BaseApplication): self.config.password = getpass.getpass(prompt=prompt) self.handler = CrTplHandler( - appname=self.appname, verbose=self.verbose, base_dir=self.base_dir) + appname=self.appname, verbose=self.verbose, base_dir=self.base_dir, config=self.config) - self.handler.config = self.config if self.args.rotate: self.handler.rotate_only = True if self.args.abort: self.handler.abort = True + self.handler.vsphere.initialized = True self.handler.initialized = True self.initialized = True diff --git a/lib/cr_vmware_tpl/handler.py b/lib/cr_vmware_tpl/handler.py index ad7fa4a..75dd9e1 100644 --- a/lib/cr_vmware_tpl/handler.py +++ b/lib/cr_vmware_tpl/handler.py @@ -37,6 +37,8 @@ from fb_tools.errors import CannotConnectVsphereError, NoDatastoreFoundError from fb_tools.handler import BaseHandler +from fb_tools.vsphere import BaseVsphereHandler + from .config import CrTplConfiguration __version__ = '0.10.1' @@ -104,8 +106,17 @@ class CrTplHandler(BaseHandler): self.abort = False self.postinstall_errors = None + self.vsphere = BaseVsphereHandler( + appname=self.appname, verbose=self.verbose, base_dir=self.base_dir, + host=self.config.vsphere_host, port=self.config.vsphere_port, + user=self.config.vsphere_user, password=self.config.password, + dc=self.config.dc, cluster=self.config.vsphere_cluster, + simulate=self.simulate, force=self.force, + terminal_has_colors=self.terminal_has_colors, initialized=False) + if initialized: self.initialized = True + self.vsphere.initialized = True # ------------------------------------------------------------------------- def __call__(self): @@ -119,6 +130,10 @@ class CrTplHandler(BaseHandler): "self.config is not a CrTplConfiguration-instance, but a " "{}-instance instead.").format(self.config.__class__.__name__)) + + return + + LOG.debug("Connecting to vSphere host {h}:{p} as {u!r} ...".format( h=self.config.vsphere_host, p=self.config.vsphere_port, u=self.config.vsphere_user)) diff --git a/python_fb_tools b/python_fb_tools index 0aa1e1f..a44f6dc 160000 --- a/python_fb_tools +++ b/python_fb_tools @@ -1 +1 @@ -Subproject commit 0aa1e1fd0335acf3f2447d1c00d413e93aced508 +Subproject commit a44f6dc298b3ecbacceab04c51ca82d0b1a4b71e -- 2.39.5