]> git.apps.os.sepia.ceph.com Git - teuthology.git/commitdiff
make connect work if no roles are specified
authorSage Weil <sage@newdream.net>
Mon, 11 Jul 2011 21:23:31 +0000 (14:23 -0700)
committerSage Weil <sage@newdream.net>
Mon, 11 Jul 2011 21:23:31 +0000 (14:23 -0700)
This is useful for -nuke.

teuthology/task/internal.py

index 3782792aa9234a4a4e1bb4f196c7a38de9c910b7..337cf8075be6553b408a7f4a49a19b638f05e4a0 100644 (file)
@@ -97,8 +97,13 @@ def connect(ctx, config):
     remotes = [remote.Remote(name=t, ssh=connection.connect(t))
                for t in ctx.config['targets']]
     ctx.cluster = orchestra.cluster.Cluster()
-    for rem, roles in zip(remotes, ctx.config['roles']):
-        ctx.cluster.add(rem, roles)
+    if 'roles' in ctx.config:
+        for rem, roles in zip(remotes, ctx.config['roles']):
+            ctx.cluster.add(rem, roles)
+    else:
+        for rem in remotes:
+            ctx.cluster.add(rem, rem.name)
+        
 
 def check_conflict(ctx, config):
     log.info('Checking for old test directory...')