From: Sage Weil Date: Fri, 1 Nov 2013 17:56:42 +0000 (-0700) Subject: install.upgrade: fix overrides of sha1|tag|branch X-Git-Tag: 1.1.0~1785^2 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=d13c29cf506bb9f784aa304754e7189bec6f02e5;p=teuthology.git install.upgrade: fix overrides of sha1|tag|branch 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 --- diff --git a/teuthology/task/install.py b/teuthology/task/install.py index e04f41d1..80dc51ea 100644 --- a/teuthology/task/install.py +++ b/teuthology/task/install.py @@ -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]