]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
Fix the incomplete substitute_placeholders() fix
authorZack Cerza <zack@cerza.org>
Mon, 14 Jul 2014 21:16:55 +0000 (15:16 -0600)
committerZack Cerza <zack@cerza.org>
Mon, 14 Jul 2014 21:16:55 +0000 (15:16 -0600)
Signed-off-by: Zack Cerza <zack.cerza@inktank.com>
teuthology/suite.py

index c2acf9d00e42aaab731ddf5b3d6c411c1936edf4..95483bd6d103084c9226996f36e5084dd5a47d7f 100644 (file)
@@ -631,15 +631,19 @@ def substitute_placeholders(input_dict, values_dict):
                         values to be substituted.
     :returns:           The modified input_dict
     """
-    input_dict = dict(input_dict)
-    for (key, value) in input_dict.iteritems():
-        if isinstance(value, dict):
-            substitute_placeholders(value, values_dict)
-        elif isinstance(value, Placeholder):
-            # If there is a Placeholder without a corresponding entry in
-            # values_dict, we will hit a KeyError - we want this.
-            input_dict[key] = values_dict[value.name]
-    return input_dict
+    input_dict = copy.deepcopy(input_dict)
+
+    def _substitute(input_dict, values_dict):
+        for (key, value) in input_dict.iteritems():
+            if isinstance(value, dict):
+                _substitute(value, values_dict)
+            elif isinstance(value, Placeholder):
+                # If there is a Placeholder without a corresponding entry in
+                # values_dict, we will hit a KeyError - we want this.
+                input_dict[key] = values_dict[value.name]
+        return input_dict
+
+    return _substitute(input_dict, values_dict)
 
 
 # Template for the config that becomes the base for each generated job config