fix ns-op-list when status is FAILED and no errorMessage 36/8636/2
authorgarciadeblas <gerardo.garciadeblas@telefonica.com>
Wed, 26 Feb 2020 09:10:55 +0000 (09:10 +0000)
committergarciadeblas <gerardo.garciadeblas@telefonica.com>
Thu, 5 Mar 2020 09:29:25 +0000 (09:29 +0000)
Change-Id: I7964b245cf6677d3249fcaa3c5d5593a0fcd0af6
Signed-off-by: garciadeblas <gerardo.garciadeblas@telefonica.com>
osmclient/scripts/osm.py

index fe5318b..2c0cf12 100755 (executable)
@@ -717,7 +717,7 @@ def ns_op_list(ctx, name, long):
             else:
                 detail = "In queue. Current position: {}".format(op['queuePosition'])
         elif op['operationState']=='FAILED' or op['operationState']=='FAILED_TEMP':
-            detail = op['errorMessage']
+            detail = op.get('errorMessage','-')
         date = datetime.fromtimestamp(op['startTime']).strftime("%Y-%m-%dT%H:%M:%S")
         last_update = datetime.fromtimestamp(op['statusEnteredTime']).strftime("%Y-%m-%dT%H:%M:%S")
         if long: