]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
Add a useful error message in case of an invalid hostname
authorZack Cerza <zack@cerza.org>
Mon, 5 Aug 2013 23:48:27 +0000 (18:48 -0500)
committerZack Cerza <zack@cerza.org>
Tue, 6 Aug 2013 20:21:34 +0000 (15:21 -0500)
teuthology/lock.py

index 65d1fcf796211ad1507e05dd3d85005b7ebde128..e98444e76324337f22cc020827f87210990f967b 100644 (file)
@@ -281,7 +281,14 @@ Lock, unlock, or query lock status of machines.
         assert ctx.desc is None, '--desc does nothing with --list'
 
         if machines:
-            statuses = [ls.get_status(ctx, machine) for machine in machines]
+            statuses = []
+            for machine in machines:
+                status = ls.get_status(ctx, machine)
+                if status:
+                    statuses.append(status)
+                else:
+                    log.error("Lockserver doesn't know about machine: %s" %
+                              machine)
         else:
             statuses = list_locks(ctx)
         vmachines = []
@@ -445,7 +452,7 @@ to run on, or use -a to check all of them automatically.
                             machines.append(t)
         except IOError, e:
             raise argparse.ArgumentTypeError(str(e))
-    
+
     return scan_for_locks(ctx, machines)
 
 def keyscan_check(ctx, machines):
@@ -485,7 +492,7 @@ def update_keys(ctx, out, current_locks):
                 log.error('failed to update %s!', full_name)
                 ret = 1
     return ret
-    
+
 def scan_for_locks(ctx, machines):
     out, current_locks = keyscan_check(ctx, machines)
     return update_keys(ctx, out, current_locks)