From 396097d7af3f4870b45dcfe9258d0904a98ec96d Mon Sep 17 00:00:00 2001 From: Vasu Kulkarni Date: Fri, 25 May 2018 19:11:33 -0700 Subject: [PATCH] osd addition fix in roles and cleanup shipped files Signed-off-by: Vasu Kulkarni --- teuthology/task/ceph_ansible.py | 21 +++++++++++++++++++-- teuthology/task/install/util.py | 5 +++-- 2 files changed, 22 insertions(+), 4 deletions(-) diff --git a/teuthology/task/ceph_ansible.py b/teuthology/task/ceph_ansible.py index 276e8f4f91..67c17b2ce2 100644 --- a/teuthology/task/ceph_ansible.py +++ b/teuthology/task/ceph_ansible.py @@ -223,6 +223,19 @@ class CephAnsible(Task): run.Raw('~/ceph-ansible/'), ] ) + shipped_files = ['/usr/bin/daemon-helper', '/usr/bin/adjust-ulimits'] + testdir = misc.get_testdir(self.ctx) + valgrind_file = os.path.join(testdir, 'valgrind.supp') + shipped_files.append(valgrind_file) + self.ctx.cluster.run( + args=[ + 'sudo', + 'rm', + '-f', + '--', + ] + list(shipped_files), + check_status=False, + ) if self.config.get('rhbuild'): installer_node.run( args=[ @@ -537,9 +550,8 @@ class CephAnsible(Task): new_remote_role[remote] = [] generate_osd_list = True for role in roles: - _, rol, id = misc.split_role(role) + cluster, rol, id = misc.split_role(role) if role.startswith('osd'): - new_remote_role[remote].append(role) if generate_osd_list: # gather osd ids as seen on host out = StringIO() @@ -561,6 +573,11 @@ class CephAnsible(Task): id = osd_list.pop() log.info("Registering Daemon {rol} {id}".format(rol=rol, id=id)) ctx.daemons.add_daemon(remote, rol, id) + if len(role.split('.')) == 2: + osd_role = "{rol}.{id}".format(rol=rol, id=id) + else: + osd_role = "{c}.{rol}.{id}".format(c=cluster, rol=rol, id=id) + new_remote_role[remote].append(osd_role) elif role.startswith('mon') or role.startswith('mgr') or \ role.startswith('mds') or role.startswith('rgw'): hostname = remote.shortname diff --git a/teuthology/task/install/util.py b/teuthology/task/install/util.py index 59547e4422..1c8c5eaf01 100644 --- a/teuthology/task/install/util.py +++ b/teuthology/task/install/util.py @@ -62,10 +62,11 @@ def ship_utilities(ctx, config): :param ctx: Context :param config: Configuration """ - log.info(config) testdir = teuthology.get_testdir(ctx) filenames = [] - + if config is None: + config = dict() + log.info(config) log.info('Shipping valgrind.supp...') with file( os.path.join(os.path.dirname(__file__), 'valgrind.supp'), -- 2.39.5