]> git.apps.os.sepia.ceph.com Git - teuthology.git/commitdiff
Add assert to catch simple typos in roles list.
authorTommi Virtanen <tommi.virtanen@dreamhost.com>
Mon, 15 Aug 2011 16:36:06 +0000 (09:36 -0700)
committerTommi Virtanen <tommi.virtanen@dreamhost.com>
Mon, 15 Aug 2011 16:36:06 +0000 (09:36 -0700)
Input of "roles:\n- [mds,1]" used to make teuthology crash
in a non-obviou way.

teuthology/task/internal.py

index 0aa77c8d6e28d4046a59ae68214766b083e89d96..5829d59d1b612988613fdbb1c9cf9f230a8bb572 100644 (file)
@@ -118,6 +118,8 @@ def connect(ctx, config):
     ctx.cluster = orchestra.cluster.Cluster()
     if 'roles' in ctx.config:
         for rem, roles in zip(remotes, ctx.config['roles']):
+            assert all(isinstance(role, str) for role in roles), \
+                "Roles in config must be strings: %r" % roles
             ctx.cluster.add(rem, roles)
     else:
         for rem in remotes: