From cbb827b7f6026629970a089dbd275b15509a1d03 Mon Sep 17 00:00:00 2001 From: Frank Brehm Date: Mon, 13 Jun 2022 12:49:46 +0200 Subject: [PATCH] Adding generation of VSPhereConfigInfo to class CrTplConfiguration in module cr_vmware_tpl.config. --- lib/cr_vmware_tpl/config.py | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/lib/cr_vmware_tpl/config.py b/lib/cr_vmware_tpl/config.py index 35a10ca..51161bf 100644 --- a/lib/cr_vmware_tpl/config.py +++ b/lib/cr_vmware_tpl/config.py @@ -20,9 +20,11 @@ from pathlib import Path # Own modules from fb_tools.config import ConfigError, BaseConfiguration +from fb_vmware.config import VSPhereConfigInfo + from .xlate import XLATOR -__version__ = '1.6.1' +__version__ = '1.7.0' LOG = logging.getLogger(__name__) _ = XLATOR.gettext @@ -141,6 +143,11 @@ class CrTplConfiguration(BaseConfiguration): self.vmware_cfg_version = self.default_vmware_cfg_version self.os_version = self.default_os_version + self.vsphere_info = VSPhereConfigInfo( + host=self.default_vsphere_host, port=self.default_vsphere_port, dc=self.default_dc, + use_https=True, user=self.default_vsphere_user, + appname=self.appname, verbose=self.verbose, base_dir=self.base_dir) + self.storage_cluster = self.default_storage_cluster self.tpl_vm_domain = self.default_tpl_vm_domain @@ -322,15 +329,19 @@ class CrTplConfiguration(BaseConfiguration): if key.lower() == 'host': self.vsphere_host = value + self.vsphere_info.host = value continue elif key.lower() == 'port': self.vsphere_port = int(value) + self.vsphere_info.port = value continue elif key.lower() == 'user': self.vsphere_user = value + self.vsphere_info.user = value continue elif key.lower() == 'password': self.password = value + self.vsphere_info.password = value continue elif key.lower() == 'cluster': self.vsphere_cluster = value @@ -339,6 +350,7 @@ class CrTplConfiguration(BaseConfiguration): self.folder = value elif key.lower() == 'dc': self.dc = value + self.vsphere_info.dc = value elif key.lower() == 'max_nr_templates_stay': v = int(value) -- 2.39.5