From: Ilya Dryomov Date: Thu, 30 Jul 2015 17:42:25 +0000 (+0300) Subject: kernel: amend normalize_config() logic X-Git-Tag: 1.1.0~859^2~1 X-Git-Url: http://git.apps.os.sepia.ceph.com/?a=commitdiff_plain;h=4b601ae7da85fe866fc7720962469876fbbc1fd1;p=teuthology.git kernel: amend normalize_config() logic In the case where we stamp out a config for all roles, don't take a shortcut and stamp it out once per remote. Instead, do it for each role, so that the number of items in the resulting dict in this case is equal to the number of roles and not to the number of remotes. This is a necessary prerequisite for override support - otherwise something like kernel: client: branch: testing override: kernel: branch: wip-foobar won't be deep_merged()'ed correctly if the role:remote mapping looks like remote1: mon.a, osd.0, osd.1, osd2 remote2: mds.a, client.0 because we'd have mon.a: branch: wip-foobar mds.a: branch: wip-foobar on the override side and client.0: branch: testing on the original config side. Since those three keys don't overlap, we'd end up with testing kernel on client.0, which is incorrect. This doesn't result in any functional changes - validate_config() will reduce such config as usual. Signed-off-by: Ilya Dryomov --- diff --git a/teuthology/task/kernel.py b/teuthology/task/kernel.py index ea0c8b08a7..09a64b4884 100644 --- a/teuthology/task/kernel.py +++ b/teuthology/task/kernel.py @@ -77,8 +77,8 @@ def normalize_config(ctx, config): new_config = {} if config is None: config = CONFIG_DEFAULT - for _, roles_for_host in ctx.cluster.remotes.iteritems(): - new_config[roles_for_host[0]] = config + for role in teuthology.all_roles(ctx.cluster): + new_config[role] = config return new_config new_config = {}