From f854916efd080a3faad92209d7a4f453354934c2 Mon Sep 17 00:00:00 2001 From: Frank Brehm Date: Thu, 22 Mar 2018 17:32:23 +0100 Subject: [PATCH] Adding network to configuration --- etc/create-vmware-template.ini.default | 2 ++ lib/cr_vmware_tpl/config.py | 7 ++++++- 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/etc/create-vmware-template.ini.default b/etc/create-vmware-template.ini.default index 9975532..a58ab1e 100644 --- a/etc/create-vmware-template.ini.default +++ b/etc/create-vmware-template.ini.default @@ -20,4 +20,6 @@ ;data_size_gb = 30 +;network = 192.168.88.0_23 + ; vim: filetype=dosini diff --git a/lib/cr_vmware_tpl/config.py b/lib/cr_vmware_tpl/config.py index 22d71d9..5a661a0 100644 --- a/lib/cr_vmware_tpl/config.py +++ b/lib/cr_vmware_tpl/config.py @@ -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() # ============================================================================= -- 2.39.5