]> git.apps.os.sepia.ceph.com Git - teuthology.git/commitdiff
Clarify error when --lock is used with no targets 507/head
authorZack Cerza <zack@redhat.com>
Fri, 29 May 2015 16:37:10 +0000 (10:37 -0600)
committerZack Cerza <zack@redhat.com>
Fri, 29 May 2015 16:37:10 +0000 (10:37 -0600)
http://tracker.ceph.com/issues/11812

Signed-off-by: Zack Cerza <zack@redhat.com>
teuthology/lock.py

index 48d295151a8788d34f4d5c21c7e1c212dec4a4bd..3a078fab501fbf527dfbef5aa05e6e5145bafe1c 100644 (file)
@@ -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'