]> git.apps.os.sepia.ceph.com Git - teuthology.git/commit
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)
commit4b601ae7da85fe866fc7720962469876fbbc1fd1
tree60c3fa5ff7631e4aba9ede4305aaa731f25c424b
parent0597ce084ea4e5a48d22ec359fa06810667fbebe
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 <idryomov@gmail.com>
teuthology/task/kernel.py