]> Frank Brehm's Git Trees - pixelpark/create-terraform.git/commitdiff
Changing check for valid Puppet role name
authorFrank Brehm <frank.brehm@pixelpark.com>
Wed, 13 Nov 2019 17:26:25 +0000 (18:26 +0100)
committerFrank Brehm <frank.brehm@pixelpark.com>
Wed, 13 Nov 2019 17:26:25 +0000 (18:26 +0100)
lib/cr_tf/terraform/vm.py

index 782b1d1c436b91e0bf4d3c5bc06ce068449df4c0..4fd19dd71cce8e6232ac6fc9c0a7ff398258df72 100644 (file)
@@ -37,7 +37,7 @@ from .disk import TerraformDisk, TerraformDiskDict
 
 from .interface import TerraformInterface
 
-__version__ = '1.4.3'
+__version__ = '1.4.4'
 
 LOG = logging.getLogger(__name__)
 
@@ -121,6 +121,7 @@ class TerraformVm(HandlingObject):
     re_memory_value = re.compile(r'^\s*(\d+(?:\.\d*)?)\s*(?:(\D+)\s*)?$')
 
     re_invalid_chars = re.compile(r'[^a-z0-9@\._-]', re.IGNORECASE)
+    re_invalid_chars_role = re.compile(r'[^a-z0-9:@\._-]', re.IGNORECASE)
 
     re_disk_size = re.compile(r'^\s*size\s*$', re.IGNORECASE)
     re_disk_mountpoint = re.compile(r'^\s*mount[_-]?point\s*$', re.IGNORECASE)
@@ -466,7 +467,7 @@ class TerraformVm(HandlingObject):
             return True
 
         if cls.re_key_puppet_role.search(key) and val_stripped:
-            if cls.re_invalid_chars.search(val_stripped):
+            if cls.re_invalid_chars_role.search(val_stripped):
                 LOG.error(_("Invalid puppet role {!r}.").format(value))
             else:
                 vm.puppet_role = val_stripped