From: garciadeblas Date: Wed, 26 Feb 2020 09:10:55 +0000 (+0000) Subject: fix ns-op-list when status is FAILED and no errorMessage X-Git-Tag: v7.1.0rc1^2~19 X-Git-Url: https://osm.etsi.org/gitweb/?a=commitdiff_plain;h=1dcfc22c87e588df01723d3c3c407450ddda5405;p=osm%2Fosmclient.git fix ns-op-list when status is FAILED and no errorMessage Change-Id: I7964b245cf6677d3249fcaa3c5d5593a0fcd0af6 Signed-off-by: garciadeblas --- 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: