From: Frank Brehm Date: Tue, 23 Oct 2018 15:39:56 +0000 (+0200) Subject: Integrating vsphere modules X-Git-Tag: 0.3.2^2~37 X-Git-Url: https://git.uhu-banane.net/?a=commitdiff_plain;h=644c7b038fc3b134ee84ea4bc87208aa17a6a7b6;p=pixelpark%2Fcreate-vmware-tpl.git Integrating vsphere modules --- 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