From 0ce72d7f01c0c75081f032075fa1ab4164f98f41 Mon Sep 17 00:00:00 2001 From: Dan Mick Date: Wed, 2 Oct 2013 14:23:45 -0700 Subject: [PATCH] rest-api.py: fix up client identification The code to extract which clients to start the API on was confused; fix it up. Also, strip off 'client.' instead of 'clients' (since it was done with len(), the result was the same, but confusing) Signed-off-by: Dan Mick --- teuthology/task/rest-api.py | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/teuthology/task/rest-api.py b/teuthology/task/rest-api.py index 481bd7fd8d..4028f4773c 100644 --- a/teuthology/task/rest-api.py +++ b/teuthology/task/rest-api.py @@ -79,19 +79,17 @@ def task(ctx, config): remotes = ctx.cluster.only(teuthology.is_type('client')).remotes log.info(remotes) if config == None: - for _, role_v in remotes.iteritems(): - for node in role_v: - api_clients.append(node) + api_clients = ['client.{id}'.format(id=id_) + for id_ in teuthology.all_roles_of_type(ctx.cluster, 'client')] else: - for role_v in config: - api_clients.append(role_v) + api_clients = config log.info(api_clients) testdir = teuthology.get_testdir(ctx) coverage_dir = '{tdir}/archive/coverage'.format(tdir=testdir) for rems, roles in remotes.iteritems(): for whole_id_ in roles: if whole_id_ in api_clients: - id_ = whole_id_[len('clients'):] + id_ = whole_id_[len('client.'):] keyring = '/etc/ceph/ceph.client.rest{id}.keyring'.format( id=id_) rems.run( -- 2.39.5