]> git.apps.os.sepia.ceph.com Git - teuthology.git/commitdiff
install.upgrade: deepcopy() overrides before we modify it
authorSage Weil <sage@inktank.com>
Sat, 2 Nov 2013 00:45:52 +0000 (17:45 -0700)
committerSage Weil <sage@inktank.com>
Sat, 2 Nov 2013 01:00:05 +0000 (18:00 -0700)
Since we modify the dict, make sure it is a deep copy.
Otherwise, a sequence like:

- install.upgrade:
    all:
      branch: dumpling
...
- install.upgrade:
    all: null

will delete the overrides keys in the first upgrade call and
then not have them at all in the second.

Signed-off-by: Sage Weil <sage@inktank.com>
teuthology/task/install.py

index 80dc51ea7522d0a1bfc0f7c29138d97a7e3e418b..eb07b87aa718c3afb3d74844424ccdebe51cc2bb 100644 (file)
@@ -1,6 +1,7 @@
 from cStringIO import StringIO
 
 import contextlib
+import copy
 import logging
 import time
 
@@ -1023,7 +1024,7 @@ def upgrade(ctx, config):
         if not node:
             node = {}
 
-        this_overrides = install_overrides
+        this_overrides = copy.deepcopy(install_overrides)
         if 'sha1' in node or 'tag' in node or 'branch' in node:
             log.info('config contains sha1|tag|branch, removing those keys from override')
             this_overrides.pop('sha1', None)