]> Frank Brehm's Git Trees - pixelpark/create-vmware-tpl.git/commitdiff
Configuring used datacenter in vSphere.
authorFrank Brehm <frank.brehm@pixelpark.com>
Wed, 21 Mar 2018 11:49:21 +0000 (12:49 +0100)
committerFrank Brehm <frank.brehm@pixelpark.com>
Wed, 21 Mar 2018 11:49:21 +0000 (12:49 +0100)
etc/create-vmware-template.ini.default
lib/cr_vmware_tpl/config.py

index f88ba712926599d9c08165c155d4c912d76b5214..2cac709d2f705902b34ca6c31443af4fdfd7db9f 100644 (file)
@@ -1,13 +1,15 @@
 [vSphere]
 
-; host = vcs01.ppbrln.internal
+;host = vcs01.ppbrln.internal
 
 ;port = 443
 
-; user = root
+;user = root
 
 ;password = 
 
+;dc = vmcc
+
 ;folder = templates
 
 [Template]
index b89c9cc6c2ec4dcc92cd6c45799da26646b40b30..0b9f83f6466fb4ed8404fd6ca8a4f3934f29b12c 100644 (file)
@@ -26,7 +26,7 @@ from .errors import FunctionNotImplementedError, PpError
 
 from .obj import PpBaseObject
 
-__version__ = '0.2.3'
+__version__ = '0.3.1'
 LOG = logging.getLogger(__name__)
 
 
@@ -48,6 +48,7 @@ class CrTplConfiguration(PpBaseObject):
     default_vsphere_host = 'vcs01.ppbrln.internal'
     default_vsphere_port = 443
     default_vsphere_user = 'root'
+    default_dc = 'vmcc'
     default_folder = 'templates'
     default_template_vm = 'template.pixelpark.com'
     default_template_name = 'oracle-linux-7.4-template'
@@ -60,6 +61,7 @@ class CrTplConfiguration(PpBaseObject):
         self.vsphere_host = self.default_vsphere_host
         self.vsphere_port = self.default_vsphere_port
         self.vsphere_user = self.default_vsphere_user
+        self.dc = self.default_dc
         self.password = None
         self.folder = self.default_folder
         self.template_vm = self.default_template_vm
@@ -101,6 +103,7 @@ class CrTplConfiguration(PpBaseObject):
         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_dc'] = self.default_dc
         res['default_folder'] = self.default_folder
         res['default_template_vm'] = self.default_template_vm
         res['default_template_name'] = self.default_template_name
@@ -184,6 +187,8 @@ class CrTplConfiguration(PpBaseObject):
                         continue
                     if key.lower() == 'folder':
                         self.folder = value
+                    if key.lower() == 'dc':
+                        self.dc = value
 
                 continue