From: tierno Date: Wed, 17 Jun 2020 12:56:12 +0000 (+0000) Subject: show queue status for ns-op-list X-Git-Tag: release-v8.0-start^0 X-Git-Url: https://osm.etsi.org/gitweb/?a=commitdiff_plain;ds=sidebyside;h=7b7b5cdd7856dd11f1c5fb8051d90d684ae9dfbe;hp=4c5a703b30e32b97f739ed2bbb33993ddc61c5d0;p=osm%2Fosmclient.git show queue status for ns-op-list Change-Id: I659f78e3ffaff515c6b719ae9cdfcb8d44640fdc Signed-off-by: tierno --- diff --git a/osmclient/scripts/osm.py b/osmclient/scripts/osm.py index f31d5f6..e3b5ac6 100755 --- a/osmclient/scripts/osm.py +++ b/osmclient/scripts/osm.py @@ -787,12 +787,12 @@ def ns_op_list(ctx, name, long): if op['lcmOperationType']=='action': action_name = op['operationParams']['primitive'] detail = "-" - if op['operationState']=='PROCESSING': - if op['lcmOperationType'] in ('instantiate', 'terminate'): + if op['operationState'] == 'PROCESSING': + if op['queuePosition'] is not None and op['queuePosition'] > 0: + detail = "In queue. Current position: {}".format(op['queuePosition']) + elif op['lcmOperationType'] in ('instantiate', 'terminate'): if op['stage']: detail = op['stage'] - else: - detail = "In queue. Current position: {}".format(op['queuePosition']) elif op['operationState'] in ('FAILED', 'FAILED_TEMP'): detail = op.get('errorMessage','-') date = datetime.fromtimestamp(op['startTime']).strftime("%Y-%m-%dT%H:%M:%S")