from .interface import TerraformInterface
-__version__ = '1.6.1'
+__version__ = '1.6.2'
LOG = logging.getLogger(__name__)
k=key, c=value.__class__.__name__))
return False
- val_stripped = value.strip()
+ if isinstance(value, str):
+ val_stripped = value.strip()
+ else:
+ val_stripped = str(value)
if cls.re_key_puppet_contact.search(key) and val_stripped:
if cls.re_invalid_chars.search(val_stripped):
vm.puppet_role = val_stripped
return True
- if cls.re_key_puppet_initial_install.search(key) and val_stripped:
- vm.puppet_initial_install = val_stripped
+ if cls.re_key_puppet_initial_install.search(key):
+ vm.puppet_initial_install = value
return True
if cls.re_key_puppet_tier.search(key) and val_stripped:
@classmethod
def _apply_puppetsub_vmdef2vm(cls, vm, p_key, p_value, verbose=0):
- p_value_stripped = p_value.strip()
+ if isinstance(p_value, str):
+ p_value_stripped = p_value.strip()
+ else:
+ p_value_stripped = str(p_value)
if verbose > 2:
LOG.debug(_("Evaluating sub key of {d!r}: {k!r} => {v!r}").format(
d='puppet', k=p_key, v=p_value_stripped))
vm.puppet_role = p_value_stripped
return
- if cls.re_key_initial_install.search(p_key) and p_value_stripped:
- vm.puppet_initial_install = p_value_stripped
- return True
+ if cls.re_key_initial_install.search(p_key):
+ vm.puppet_initial_install = p_value
+ return
if p_key.lower() == 'tier' and p_value_stripped:
if cls.re_invalid_chars.search(p_value_stripped):