]> Frank Brehm's Git Trees - pixelpark/create-vmware-tpl.git/commitdiff
Adding generation of VSPhereConfigInfo to class CrTplConfiguration in module cr_vmwar...
authorFrank Brehm <frank@brehm-online.com>
Mon, 13 Jun 2022 10:49:46 +0000 (12:49 +0200)
committerFrank Brehm <frank@brehm-online.com>
Mon, 13 Jun 2022 10:49:46 +0000 (12:49 +0200)
lib/cr_vmware_tpl/config.py

index 35a10caaf43369eaa67e6bb2a135cba6c40e8c4e..51161bf94806604f8eb58e8b0238126987651dbe 100644 (file)
@@ -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)