Project

General

Profile

Bug #9006

fix _get_config_value_for_remote in install task

Added by Tamilarasi muthamizhan over 9 years ago. Updated over 8 years ago.

Status:
New
Priority:
Low
Assignee:
Category:
-
Target version:
-
% Done:

0%

Source:
Q/A
Tags:
Backport:
Regression:
No
Severity:
3 - minor
Reviewed:
Affected Versions:
ceph-qa-suite:
Crash signature (v1):
Crash signature (v2):

Description

In install task, the function _get_config_value_for_remote() claims it installs the given value based on the role or 'all', it doesnt work as expected.

maybe we never hit this issue before as nowhere in the teuthology tests, we use this combination.

def _get_config_value_for_remote(ctx, remote, config, key):
    """ 
    Look through config, and attempt to determine the "best" value to use for a
    given key. For example, given:

        config = {
            'all':
                {'branch': 'master'},
            'branch': 'next'
        }
        _get_config_value_for_remote(ctx, remote, config, 'branch')

    would return 'master'.

    :param ctx: the argparse.Namespace object
    :param remote: the teuthology.orchestra.remote.Remote object
    :param config: the config dict
    :param key: the name of the value to retrieve
    """ 
    roles = ctx.cluster.remotes[remote]
    if 'all' in config:
        return config['all'].get(key)
    elif roles:
        for role in roles:
            if role in config and key in config[role]:
                return config[role].get(key)
    return config.get(key)

sample config.yaml that i used to test,

roles:
- [mon.a, mds.a, osd.0, osd.1, osd.2]
- [client.0]

targets:
  ubuntu@mira023.front.sepia.ceph.com: ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQCn68M4okUoKZ+8Mz6Izfh+v7IQdmoXLvO0AA2uR8dBlZobVvJ9NXvXsoIP3SkweWyUf3RIeglkCMIdZN/2Wp2xorN925RFOM9v3Iyr+FMlIZGrQZSVQUhtL7vQpwrQ0FUygk54LLgmPt8uvi0u8p+pCUKDl5bUSt+IoEbwoRK4uNToL3+WUs/O/i51/OT62X3btZgYcZD/jbhQiicHD1U9Tm8DmBxn95spn6SNTDuCoviuqxmrG+CoNPEPxAi4FxAX4vZbiOxP6Kb6UuP5XMVw1lxeLeuwr9QT8Kzw9SIPwhdDZm4bWZmbu5ZCg5TbcabBhoxNc67lIiOfQBKj60Qf
  ubuntu@mira042.front.sepia.ceph.com: ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQD5mVeceNoTxd9OiOWol4C4XNAXgmBn6ddzHTPr12cZWOWuoBXtDHM3wm+23v55LSXkglU6/zVAJPxipai0CzWgfjC/0cIo7eBps9KvgnSYKEyOT47GlLIWOl84dWqWbDq1lhU4MMIk+7keq5Q6LDf/Xo8+I0NGxntqH5Q8jk32Kkv4ms6GuL7GlMWr8BrfQ5V3QhXeKIV7EQiMSpMT+N4XqO0bEN3v7u0a0jckGuxnrsyCLHfWfJWs28DGWos6VnFiXV1k0rXTQYVXNzlPjFl2KqPZo9Pp+IosHakvsy60XAa4pZYGZd7dvBTOcijZ8aOvqq3rLQxf6ZBuTW9nCGet

tasks:
- chef:
- install:
    all: 
      branch: dumpling 

History

#1 Updated by Tamilarasi muthamizhan over 9 years ago

  • Priority changed from Normal to Low

#2 Updated by Dan Mick over 8 years ago

  • Assignee set to Andrew Schoen
  • Regression set to No

#3 Updated by Dan Mick over 8 years ago

  • Subject changed from fix a function in install task to fix _get_config_value_for_remote in install task

Also available in: Atom PDF