From 43267f86183d1ba6ec771a2dd200d08d6df53237 Mon Sep 17 00:00:00 2001 From: Zack Cerza Date: Fri, 29 May 2015 10:37:10 -0600 Subject: [PATCH] Clarify error when --lock is used with no targets http://tracker.ceph.com/issues/11812 Signed-off-by: Zack Cerza --- teuthology/lock.py | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/teuthology/lock.py b/teuthology/lock.py index 48d295151a..3a078fab50 100644 --- a/teuthology/lock.py +++ b/teuthology/lock.py @@ -182,9 +182,13 @@ def main(ctx): or ctx.update or ctx.brief, \ 'machines cannot be specified with that operation' else: - assert ctx.num_to_lock or ctx.list or ctx.list_targets or \ - ctx.summary or ctx.brief, \ - 'machines must be specified for that operation' + if ctx.lock: + log.error("--lock requires specific machines passed as arguments") + else: + # This condition might never be hit, but it's not clear. + assert ctx.num_to_lock or ctx.list or ctx.list_targets or \ + ctx.summary or ctx.brief, \ + 'machines must be specified for that operation' if ctx.all: assert ctx.list or ctx.list_targets or ctx.brief, \ '--all can only be used with --list, --list-targets, and --brief' -- 2.39.5