From: Frank Brehm Date: Tue, 25 Aug 2020 15:33:19 +0000 (+0200) Subject: Extendig configuration for storage cluster X-Git-Tag: 2.2.1~1^2~1^2~7^2~5 X-Git-Url: https://git.uhu-banane.org/?a=commitdiff_plain;h=748050611f1ec9da0e9efd8caec2187ce416d12b;p=pixelpark%2Fcreate-vmware-tpl.git Extendig configuration for storage cluster --- diff --git a/etc/create-vmware-template.ini.default b/etc/create-vmware-template.ini.default index 9237131..05aa5c3 100644 --- a/etc/create-vmware-template.ini.default +++ b/etc/create-vmware-template.ini.default @@ -14,6 +14,8 @@ ;folder = templates +;storage_cluster = ds-cluster-hdd-vmcc-l105-01 + [Template] ;vm_id = centos8 @@ -38,12 +40,6 @@ ;mac_address = 00:16:3e:54:ab:2b -;storage_cluster = - -;storage_cluster_prod = 'ds-cluster-hdd-vmcc-l105-01' - -;storage_cluster_test = 'Daten-Cluster-Gold_01' - [Timeouts] ; General timeout in seconds for create_vm, poweron_vm and shutdown_vm diff --git a/lib/cr_vmware_tpl/config.py b/lib/cr_vmware_tpl/config.py index db34fe2..754ba24 100644 --- a/lib/cr_vmware_tpl/config.py +++ b/lib/cr_vmware_tpl/config.py @@ -22,7 +22,7 @@ from fb_tools.config import ConfigError, BaseConfiguration from .xlate import XLATOR -__version__ = '1.5.8' +__version__ = '1.6.0' LOG = logging.getLogger(__name__) _ = XLATOR.gettext @@ -54,6 +54,7 @@ class CrTplConfiguration(BaseConfiguration): default_folder = 'templates' default_template_name = default_os_id + '-template' default_data_size_gb = 32.0 + default_storage_cluster = 'ds-cluster-hdd-vmcc-l105-01' default_num_cpus = 2 default_ram_mb = 4 * 1024 default_network = '192.168.88.0_23' @@ -140,6 +141,8 @@ class CrTplConfiguration(BaseConfiguration): self.vmware_cfg_version = self.default_vmware_cfg_version self.os_version = self.default_os_version + self.storage_cluster = self.default_storage_cluster + self.tpl_vm_domain = self.default_tpl_vm_domain self.cobbler_profile_given = False @@ -313,6 +316,7 @@ class CrTplConfiguration(BaseConfiguration): re_excl_ds = re.compile(r'^\s*excluded?[-_]datastores?\s*$', re.IGNORECASE) re_split_ds = re.compile(r'[,;\s]+') + re_storage_cluster = re.compile(r'^\s*storage[-_]?cluster\s*$', re.IGNORECASE) for (key, value) in config.items(section_name): @@ -355,6 +359,9 @@ class CrTplConfiguration(BaseConfiguration): datastores = re_split_ds.split(value.strip()) self.excluded_datastores = datastores + elif re_storage_cluster.search(key) and value.strip(): + self.storage_cluster = value.strip() + return # -------------------------------------------------------------------------