X-Git-Url: https://osm.etsi.org/gitweb/?a=blobdiff_plain;f=osmclient%2Fscripts%2Fosm.py;h=06d77e04e4eec26ec8867b1f4d99173e81679187;hb=refs%2Fchanges%2F69%2F9469%2F2;hp=f31d5f696c82c4f4e60251bc7efea07f8f14920f;hpb=4c5a703b30e32b97f739ed2bbb33993ddc61c5d0;p=osm%2Fosmclient.git diff --git a/osmclient/scripts/osm.py b/osmclient/scripts/osm.py index f31d5f6..06d77e0 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") @@ -1306,6 +1306,7 @@ def vnf_show(ctx, name, literal, filter, kdu): time.sleep(5) t += 5 print ("Could not determine KDU status") + return if literal: print(yaml.safe_dump(resp, indent=4, default_flow_style=False)) @@ -3920,7 +3921,7 @@ def upload_package(ctx, filename, skip_charm_build): @click.option('--vnf_name', default=None, help='member-vnf-index if the target is a vnf instead of a ns)') @click.option('--kdu_name', default=None, help='kdu-name if the target is a kdu)') @click.option('--vdu_id', default=None, help='vdu-id if the target is a vdu') -@click.option('--vdu_count', default=None, help='number of vdu instance of this vdu_id') +@click.option('--vdu_count', default=None, type=int, help='number of vdu instance of this vdu_id') @click.option('--action_name', prompt=True, help='action name') @click.option('--params', default=None, help='action params in YAML/JSON inline string') @click.option('--params_file', default=None, help='YAML/JSON file with action params') @@ -3956,7 +3957,7 @@ def ns_action(ctx, op_data['kdu_name'] = kdu_name if vdu_id: op_data['vdu_id'] = vdu_id - if vdu_count: + if vdu_count is not None: op_data['vdu_count_index'] = vdu_count if timeout: op_data['timeout_ns_action'] = timeout