From 1dcfc22c87e588df01723d3c3c407450ddda5405 Mon Sep 17 00:00:00 2001 From: garciadeblas Date: Wed, 26 Feb 2020 09:10:55 +0000 Subject: [PATCH] fix ns-op-list when status is FAILED and no errorMessage Change-Id: I7964b245cf6677d3249fcaa3c5d5593a0fcd0af6 Signed-off-by: garciadeblas --- osmclient/scripts/osm.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/osmclient/scripts/osm.py b/osmclient/scripts/osm.py index fe5318b..2c0cf12 100755 --- a/osmclient/scripts/osm.py +++ b/osmclient/scripts/osm.py @@ -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: -- 2.25.1