From: Mark Nelson Date: Tue, 3 Apr 2012 21:53:17 +0000 (-0700) Subject: Added assertion to check that targets > roles X-Git-Tag: 1.1.0~2585 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=1836d4672fc6ec7cdcd199c58ab64c59475fad9f;p=teuthology.git Added assertion to check that targets > roles Signed-off-by: Mark Nelson --- diff --git a/teuthology/run.py b/teuthology/run.py index 40f04f726..6430766e1 100644 --- a/teuthology/run.py +++ b/teuthology/run.py @@ -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'