X-Git-Url: https://osm.etsi.org/gitweb/?a=blobdiff_plain;ds=sidebyside;f=osmclient%2Fscripts%2Fosm.py;h=9c3e15427732fb4e34428a823facfb0a0b3cac08;hb=5802354c1a0af36373dac6dc0719d8f8c51d7fc3;hp=c1a7f1889b1a3a31256a03d8069745832b0e9f92;hpb=017c4fb032ab1f63e1ce474e12787204f33fce96;p=osm%2Fosmclient.git diff --git a/osmclient/scripts/osm.py b/osmclient/scripts/osm.py index c1a7f18..9c3e154 100755 --- a/osmclient/scripts/osm.py +++ b/osmclient/scripts/osm.py @@ -35,7 +35,7 @@ def check_client_version(obj, what, version='sol005'): :return: - :raises ClientError: if the specified version does not match the client version ''' - fullclassname = ctx.obj.__module__ + "." + ctx.obj.__class__.__name__ + fullclassname = obj.__module__ + "." + obj.__class__.__name__ message = 'the following commands or options are only supported with the option "--sol005": {}'.format(what) if version == 'v1': message = 'the following commands or options are not supported when using option "--sol005": {}'.format(what) @@ -104,7 +104,7 @@ def cli(ctx, hostname, so_port, so_project, ro_hostname, ro_port, sol005): def ns_list(ctx, filter): '''list all NS instances''' if filter: - check_client_version(ctx.obj, '--filter option') + check_client_version(ctx.obj, '--filter') resp = ctx.obj.ns.list(filter) else: resp = ctx.obj.ns.list() @@ -117,16 +117,20 @@ def ns_list(ctx, filter): fullclassname = ctx.obj.__module__ + "." + ctx.obj.__class__.__name__ if fullclassname == 'osmclient.sol005.client.Client': nsr = ns + nsr_name = nsr['name'] + nsr_id = nsr['_id'] else: nsopdata = ctx.obj.ns.get_opdata(ns['id']) nsr = nsopdata['nsr:nsr'] + nsr_name = nsr['name-ref'] + nsr_id = nsr['ns-instance-config-ref'] opstatus = nsr['operational-status'] if 'operational-status' in nsr else 'Not found' configstatus = nsr['config-status'] if 'config-status' in nsr else 'Not found' if configstatus == "config_not_needed": configstatus = "configured (no charms)" table.add_row( - [nsr['name'], - nsr['_id'], + [nsr_name, + nsr_id, opstatus, configstatus]) table.align = 'l'