]> git-server-git.apps.pok.os.sepia.ceph.com Git - teuthology.git/commitdiff
Added assertion to check that targets > roles
authorMark Nelson <mark.nelson@dreamhost.com>
Tue, 3 Apr 2012 21:53:17 +0000 (14:53 -0700)
committerSage Weil <sage@newdream.net>
Tue, 3 Apr 2012 22:56:51 +0000 (15:56 -0700)
Signed-off-by: Mark Nelson <mark.nelson@dreamhost.com>
teuthology/run.py

index 40f04f726d2e74f423c9ac8af0a49f3bc09bae48..6430766e12b238d15731a4fbdc61ffab33c32afa 100644 (file)
@@ -82,6 +82,13 @@ def main():
         level=loglevel,
         )
 
+
+    if 'targets' in ctx.config and 'roles' in ctx.config:
+        targets = len(ctx.config['targets'])
+        roles = len(ctx.config['roles'])
+        assert targets >= roles, \
+            '%d targets are needed for all roles but found %d listed.' % (roles, targets)
+       
     if ctx.block:
         assert ctx.lock, \
             'the --block option is only supported with the --lock option'