]> git.apps.os.sepia.ceph.com Git - teuthology.git/commitdiff
Don't dump all vm_host details when listing
authorZack Cerza <zack.cerza@inktank.com>
Fri, 22 Aug 2014 19:37:49 +0000 (13:37 -0600)
committerZack Cerza <zack.cerza@inktank.com>
Mon, 25 Aug 2014 17:14:39 +0000 (11:14 -0600)
Signed-off-by: Zack Cerza <zack.cerza@inktank.com>
teuthology/lock.py

index b0ce02ddf91600950743febe6ffdf46fe564540a..5bc9b3c810c5d084963bcd7ed5ee64bb8b06a470 100644 (file)
@@ -120,6 +120,14 @@ def main(ctx):
                 statuses = [_status for _status in statuses
                             if _status['description'] is not None and
                             _status['description'].find(ctx.desc_pattern) >= 0]
+
+            # When listing, only show the vm_host's name, not every detail
+            for s in statuses:
+                if not s.get('is_vm', False):
+                    continue
+                vm_host_name = s.get('vm_host', dict())['name']
+                if vm_host_name:
+                    s['vm_host'] = vm_host_name
             if ctx.list:
                     print json.dumps(statuses, indent=4)