]> git-server-git.apps.pok.os.sepia.ceph.com Git - teuthology.git/commitdiff
install.upgrade: fix overrides of sha1|tag|branch 148/head
authorSage Weil <sage@inktank.com>
Fri, 1 Nov 2013 17:56:42 +0000 (10:56 -0700)
committerSage Weil <sage@inktank.com>
Fri, 1 Nov 2013 17:56:42 +0000 (10:56 -0700)
If the upgrade task config has a branch: (or tag or sha1), do
not apply the sha1|branch|tag overrides keys.  This fixes the
breakage from 280f783c2e8dda0df6afb4de0b115aad1614fbdc which
made

overrides:
  install:
    ceph:
      sha1: f88866fe9c218e03b3f89ff21e2b7b655aa74294
tasks:
...
- install.upgrade:
    all:
      branch: dumpling

...use the sha1 from the overrides instead of the explicitly
specified branch.  The intention was to only use the overrides
when the version was not specified (whether it was sha1 or
branch or tag).

At some point we should probably make the same change for
install function in install.py, but let's fix this first to
get the upgrade tests working.

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

index e04f41d1c6ba94a66187fb8654f7836e2a715119..80dc51ea7522d0a1bfc0f7c29138d97a7e3e418b 100644 (file)
@@ -981,6 +981,9 @@ def upgrade(ctx, config):
         - install.upgrade:
             all:
 
+    (HACK: the overrides will *only* apply the sha1/branch/tag if those
+    keys are not present in the config.)
+
     :param ctx: the argparse.Namespace object
     :param config: the config dict
     """
@@ -997,7 +1000,7 @@ def upgrade(ctx, config):
     # unspecified/implicit.
     install_overrides = ctx.config.get(
         'overrides', {}).get('install', {}).get(project, {})
-    log.info('project %s overrides %s', project, install_overrides)
+    log.info('project %s config %s overrides %s', project, config, install_overrides)
 
     # FIXME: extra_pkgs is not distro-agnostic
     extra_pkgs = config.get('extra_packages', [])
@@ -1019,8 +1022,16 @@ def upgrade(ctx, config):
     for remote, node in remotes.iteritems():
         if not node:
             node = {}
-        teuthology.deep_merge(node, install_overrides)
+
+        this_overrides = 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)
+            this_overrides.pop('tag', None)
+            this_overrides.pop('branch', None)
+        teuthology.deep_merge(node, this_overrides)
         log.info('remote %s config %s', remote, node)
+
         system_type = teuthology.get_system_type(remote)
         assert system_type in ('deb', 'rpm')
         pkgs = PACKAGES[project][system_type]