Fix minor bug in openmano client with subcommand vim-image-list 09/1009/2
authorgarciadeblas <gerardo.garciadeblas@telefonica.com>
Tue, 24 Jan 2017 16:16:18 +0000 (17:16 +0100)
committergarciadeblas <gerardo.garciadeblas@telefonica.com>
Tue, 24 Jan 2017 17:03:14 +0000 (18:03 +0100)
Change-Id: I2820cda1ce01f00e2c2d52d0be251d76ba16c223
Signed-off-by: garciadeblas <gerardo.garciadeblas@telefonica.com>
openmano

index fc60035..5027710 100755 (executable)
--- a/openmano
+++ b/openmano
@@ -127,14 +127,14 @@ def _print_verbose(mano_response, verbose_level=0):
                 uuid = content['id']
             elif "vim_id" in content:
                 uuid = content['vim_id']
-            myoutput = "%s %s" %(uuid.ljust(38),content['name'].ljust(20))
+            myoutput = "%s %s" %(uuid.ljust(38),content.get('name',"").ljust(20))
             if "status" in content:
                 myoutput += " " + content['status'].ljust(20)
             elif "enabled" in content and not content["enabled"]:
                 myoutput += " enabled=False".ljust(20)
             if verbose_level >=1:
                 if 'created_at' in content:
-                    myoutput += " " + content['created_at'].ljust(20)
+                    myoutput += " " + content.get('created_at',"").ljust(20)
                 if verbose_level >=2:
                     new_line='\n'
                     if 'type' in content and content['type']!=None: