]> git.apps.os.sepia.ceph.com Git - teuthology.git/commitdiff
kernel: amend normalize_config() logic
authorIlya Dryomov <idryomov@gmail.com>
Thu, 30 Jul 2015 17:42:25 +0000 (20:42 +0300)
committerIlya Dryomov <idryomov@gmail.com>
Fri, 31 Jul 2015 10:07:32 +0000 (13:07 +0300)
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 <idryomov@gmail.com>
teuthology/task/kernel.py

index ea0c8b08a73bc2e0589d00403b44b78aa8bda6dd..09a64b48844c85907aca82c34ce9a186a99f8e21 100644 (file)
@@ -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 = {}