]> Frank Brehm's Git Trees - pixelpark/create-terraform.git/commitdiff
Version bump to 1.6.7 and trying to fix lib/cr_tf/terraform/vm.py
authorFrank Brehm <frank@brehm-online.com>
Tue, 19 Jul 2022 12:42:30 +0000 (14:42 +0200)
committerFrank Brehm <frank@brehm-online.com>
Tue, 19 Jul 2022 12:42:30 +0000 (14:42 +0200)
lib/cr_tf/__init__.py
lib/cr_tf/terraform/vm.py

index a2a7fb375f7ae8f4275dccbcb8205e4b6c9c9b4f..09714d5ac3aafcbe40bd34a4eaf2951a534d7813 100644 (file)
@@ -1,7 +1,7 @@
 #!/bin/env python3
 # -*- coding: utf-8 -*-
 
-__version__ = '1.6.6'
+__version__ = '1.6.7'
 
 MIN_VERSION_TERRAFORM = '1.0.5'
 MAX_VERSION_TERRAFORM = '1.3.0'
index 4dace59d741600c9f2d1cfc13d53adceb0a8aa9b..1744e4a62e6c0020282cd2cf8aa0977831bcae4b 100644 (file)
@@ -37,7 +37,7 @@ from .disk import TerraformDisk, TerraformDiskDict
 
 from .interface import TerraformInterface
 
-__version__ = '1.6.1'
+__version__ = '1.6.2'
 
 LOG = logging.getLogger(__name__)
 
@@ -492,7 +492,10 @@ class TerraformVm(HandlingObject):
                     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):
@@ -522,8 +525,8 @@ class TerraformVm(HandlingObject):
                 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:
@@ -548,7 +551,10 @@ class TerraformVm(HandlingObject):
     @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))
@@ -581,9 +587,9 @@ class TerraformVm(HandlingObject):
                 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):