from .obj import PpBaseObject
-__version__ = '0.5.2'
+__version__ = '0.5.3'
LOG = logging.getLogger(__name__)
default_network = '192.168.88.0_23'
default_mac_address = '00:16:3e:54:ab:2b'
default_max_wait_for_finish_install = 60 * 60
+ default_max_nr_templates_stay = 4
min_max_wait_for_finish_install = 3 * 60
max_max_wait_for_finish_install = 24 * 60 * 60
self.network = self.default_network
self.mac_address = self.default_mac_address
self.max_wait_for_finish_install = self.default_max_wait_for_finish_install
+ self.max_nr_templates_stay = self.default_max_nr_templates_stay
self.excluded_datastores = []
res['default_network'] = self.default_network
res['default_mac_address'] = self.default_mac_address
res['default_max_wait_for_finish_install'] = self.default_max_wait_for_finish_install
+ res['default_max_nr_templates_stay'] = self.default_max_nr_templates_stay
res['min_max_wait_for_finish_install'] = self.min_max_wait_for_finish_install
res['max_max_wait_for_finish_install'] = self.max_max_wait_for_finish_install
res['data_size_mb'] = self.data_size_mb
if key.lower() == 'dc':
self.dc = value
+ if key.lower() == 'max_nr_templates_stay':
+ v = int(value)
+ if v < 1:
+ LOG.error((
+ "Value {val} for max_nr_templates_stay is less than {minval}, "
+ "using {default}.").format(
+ val=v, minval=1,
+ default=self.default_max_nr_templates_stay))
+ elif v >= 100:
+ LOG.error((
+ "Value {val} for max_nr_templates_stay is greater than {maxval}, "
+ "using {default}.").format(
+ val=v, maxval=100,
+ default=self.default_max_nr_templates_stay))
+ else:
+ self.max_nr_templates_stay = v
+
if re_excl_ds.search(key):
datastores = re_split_ds.split(value.strip())
self.excluded_datastores = datastores
if key.lower() == 'max_wait_for_finish_install':
v = float(value)
if v < self.min_max_wait_for_finish_install:
- LOG.err((
+ LOG.error((
"Value {val} for max_wait_for_finish_install is less than {minval}, "
"using {default} seconds.").format(val=v,
minval=self.min_max_wait_for_finish_install,
default=self.default_max_wait_for_finish_install))
elif v > self.max_max_wait_for_finish_install:
- LOG.err((
+ LOG.error((
"Value {val} for max_wait_for_finish_install is greater than {maxval}, "
"using {default} seconds.").format(val=v,
maxval=self.max_max_wait_for_finish_install,