From: Zack Cerza Date: Fri, 29 May 2015 16:37:10 +0000 (-0600) Subject: Clarify error when --lock is used with no targets X-Git-Tag: 1.1.0~932^2 X-Git-Url: http://git.apps.os.sepia.ceph.com/?a=commitdiff_plain;h=43267f86183d1ba6ec771a2dd200d08d6df53237;p=teuthology.git Clarify error when --lock is used with no targets http://tracker.ceph.com/issues/11812 Signed-off-by: Zack Cerza --- 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'