]> Frank Brehm's Git Trees - pixelpark/create-terraform.git/commitdiff
Adding some allowed puppet environments, changing behaviour on unknown environment
authorFrank Brehm <frank.brehm@pixelpark.com>
Fri, 3 Sep 2021 08:51:07 +0000 (10:51 +0200)
committerFrank Brehm <frank.brehm@pixelpark.com>
Fri, 3 Sep 2021 08:51:07 +0000 (10:51 +0200)
lib/cr_tf/terraform/vm.py

index e8c3868161f5e90422cb8bdd83b527bd3ff6a851..fd21ec314590897c674055fcc839f19af09c789e 100644 (file)
@@ -37,7 +37,7 @@ from .disk import TerraformDisk, TerraformDiskDict
 
 from .interface import TerraformInterface
 
-__version__ = '1.5.2'
+__version__ = '1.5.3'
 
 LOG = logging.getLogger(__name__)
 
@@ -53,7 +53,9 @@ PUPPET_ENVIRONMENTS = (
     'production',
     'test',
     'development',
-    'dev_chronie'
+    'pre_production',
+    'dev_chronie',
+    'dev_fbrehm'
 )
 
 DS_TYPES = (
@@ -93,6 +95,8 @@ class TerraformVm(HandlingObject):
     default_purpose = "Customer project"
     default_rootdisk_size = 32.0
 
+    valid_puppet_environments = copy.copy(PUPPET_ENVIRONMENTS)
+
     max_num_cpus = 64
     memory_chunk = 256
     max_memory = 512 * 1024
@@ -1160,9 +1164,8 @@ class TerraformVm(HandlingObject):
             return
 
         if val not in PUPPET_ENVIRONMENTS:
-            LOG.warn(_("A puppet environment must be one of {li} (given: {v!r}).").format(
+            LOG.warn(_("A puppet environment should be one of {li} (given: {v!r}).").format(
                 li=pp(PUPPET_ENVIRONMENTS), v=value))
-            return
 
         self._puppet_env = val