]> Frank Brehm's Git Trees - pixelpark/create-vmware-tpl.git/commitdiff
Adding cluster configuration
authorFrank Brehm <frank.brehm@pixelpark.com>
Tue, 23 Oct 2018 10:35:14 +0000 (12:35 +0200)
committerFrank Brehm <frank.brehm@pixelpark.com>
Tue, 23 Oct 2018 10:35:14 +0000 (12:35 +0200)
lib/cr_vmware_tpl/config.py

index 735c340fdd89ed981e8e8827c8177a23d7247ea9..048e29e448407d7af84ce6973f86c90a39c4803c 100644 (file)
@@ -19,7 +19,7 @@ import six
 # Own modules
 from fb_tools.config import ConfigError, BaseConfiguration
 
-__version__ = '0.6.1'
+__version__ = '0.6.2'
 LOG = logging.getLogger(__name__)
 
 
@@ -41,6 +41,7 @@ class CrTplConfiguration(BaseConfiguration):
     default_vsphere_host = 'vcs01.ppbrln.internal'
     default_vsphere_port = 443
     default_vsphere_user = 'root'
+    default_vsphere_cluster = 'vmcc-l105-01'
     default_dc = 'vmcc'
     default_folder = 'templates'
     default_template_vm = 'template.pixelpark.com'
@@ -65,6 +66,7 @@ class CrTplConfiguration(BaseConfiguration):
         self.vsphere_host = self.default_vsphere_host
         self.vsphere_port = self.default_vsphere_port
         self.vsphere_user = self.default_vsphere_user
+        self.vsphere_cluster = self.default_vsphere_cluster
         self.dc = self.default_dc
         self.password = None
         self.folder = self.default_folder
@@ -135,6 +137,7 @@ class CrTplConfiguration(BaseConfiguration):
         res['default_vsphere_host'] = self.default_vsphere_host
         res['default_vsphere_port'] = self.default_vsphere_port
         res['default_vsphere_user'] = self.default_vsphere_user
+        res['default_vsphere_cluster'] = self.default_vsphere_cluster
         res['default_dc'] = self.default_dc
         res['default_folder'] = self.default_folder
         res['default_template_vm'] = self.default_template_vm
@@ -194,6 +197,9 @@ class CrTplConfiguration(BaseConfiguration):
             elif key.lower() == 'password':
                 self.password = value
                 continue
+            elif key.lower() == 'cluster':
+                self.vsphere_cluster = value
+                continue
             elif key.lower() == 'folder':
                 self.folder = value
             elif key.lower() == 'dc':