From 1836d4672fc6ec7cdcd199c58ab64c59475fad9f Mon Sep 17 00:00:00 2001 From: Mark Nelson Date: Tue, 3 Apr 2012 14:53:17 -0700 Subject: [PATCH] Added assertion to check that targets > roles Signed-off-by: Mark Nelson --- teuthology/run.py | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/teuthology/run.py b/teuthology/run.py index 40f04f726d2e7..6430766e12b23 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' -- 2.39.5