]> git.apps.os.sepia.ceph.com Git - teuthology.git/commitdiff
rest-api.py: fix up client identification
authorDan Mick <dan.mick@inktank.com>
Wed, 2 Oct 2013 21:23:45 +0000 (14:23 -0700)
committerDan Mick <dan.mick@inktank.com>
Wed, 2 Oct 2013 21:25:34 +0000 (14:25 -0700)
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 <dan.mick@inktank.com>
teuthology/task/rest-api.py

index 481bd7fd8d2929aacf0190aa6d7b890d611754c4..4028f4773c8a92d108068d1f58d2d545f92bc3c3 100644 (file)
@@ -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(