]> Frank Brehm's Git Trees - pixelpark/create-vmware-tpl.git/commitdiff
Adding network to configuration
authorFrank Brehm <frank.brehm@pixelpark.com>
Thu, 22 Mar 2018 16:32:23 +0000 (17:32 +0100)
committerFrank Brehm <frank.brehm@pixelpark.com>
Thu, 22 Mar 2018 16:32:23 +0000 (17:32 +0100)
etc/create-vmware-template.ini.default
lib/cr_vmware_tpl/config.py

index 9975532a8709840c2faec85a192f0320f8cf3596..a58ab1eb12481f43acdea2b72e165acd1d6054c6 100644 (file)
@@ -20,4 +20,6 @@
 
 ;data_size_gb = 30
 
+;network = 192.168.88.0_23
+
 ; vim: filetype=dosini
index 22d71d99faf35728181e5936ae0117fbf3e432f3..5a661a09f53c62fe314412415ab84540b4bc4808 100644 (file)
@@ -26,7 +26,7 @@ from .errors import FunctionNotImplementedError, PpError
 
 from .obj import PpBaseObject
 
-__version__ = '0.4.1'
+__version__ = '0.4.2'
 LOG = logging.getLogger(__name__)
 
 
@@ -53,6 +53,7 @@ class CrTplConfiguration(PpBaseObject):
     default_template_vm = 'template.pixelpark.com'
     default_template_name = 'oracle-linux-7.4-template'
     default_data_size_gb = 30.0
+    default_network = '192.168.88.0_23'
 
     # -------------------------------------------------------------------------
     def __init__(
@@ -68,6 +69,7 @@ class CrTplConfiguration(PpBaseObject):
         self.template_vm = self.default_template_vm
         self.template_name = self.default_template_name
         self.data_size_gb = self.default_data_size_gb
+        self.network = self.default_network
 
         self.encoding = 'utf-8'
 
@@ -128,6 +130,7 @@ class CrTplConfiguration(PpBaseObject):
         res['default_template_vm'] = self.default_template_vm
         res['default_template_name'] = self.default_template_name
         res['default_data_size_gb'] = self.default_data_size_gb
+        res['default_network'] = self.default_network
         res['data_size_mb'] = self.data_size_mb
         res['data_size_kb'] = self.data_size_kb
         res['data_size'] = self.data_size
@@ -235,6 +238,8 @@ class CrTplConfiguration(PpBaseObject):
                         self.data_size_gb = float(value) / 1024.0 / 1024.0
                     if key.lower() == 'data_size':
                         self.data_size_gb = float(value) / 1024.0 / 1024.0 / 1024.0
+                    if key.lower() == 'network':
+                        self.network = value.strip()
 
 
 # =============================================================================