X-Git-Url: https://osm.etsi.org/gitweb/?a=blobdiff_plain;f=osmclient%2Fscripts%2Fosm.py;h=78f7896a1ad4e5d4bc05910c216a2e81c86ea9ca;hb=refs%2Fchanges%2F41%2F9041%2F4;hp=57fb6b34566cd5ea53e78a6605079712d7f141d7;hpb=880fc142421ab5f24f5a297388c3a57f762ffce7;p=osm%2Fosmclient.git diff --git a/osmclient/scripts/osm.py b/osmclient/scripts/osm.py index 57fb6b3..78f7896 100755 --- a/osmclient/scripts/osm.py +++ b/osmclient/scripts/osm.py @@ -290,7 +290,7 @@ def ns_list(ctx, filter, long): if ee['elementType'] not in status_ee: status_ee[ee['elementType']] = {} status_ee[ee['elementType']][ee['status']] = 1 - continue; + continue if ee['status'] in status_ee[ee['elementType']]: status_ee[ee['elementType']][ee['status']] += 1 else: @@ -992,7 +992,7 @@ def nsd_show(ctx, name, literal): # exit(1) if literal: - print(yaml.safe_dump(resp)) + print(yaml.safe_dump(resp, indent=4, default_flow_style=False)) return table = PrettyTable(['field', 'value']) @@ -1002,7 +1002,7 @@ def nsd_show(ctx, name, literal): print(table) -@cli_osm.command(name='nsd-show', short_help='shows the content of a NSD') +@cli_osm.command(name='nsd-show', short_help='shows the details of a NS package') @click.option('--literal', is_flag=True, help='print literally, no pretty table') @click.argument('name') @@ -1016,7 +1016,7 @@ def nsd_show1(ctx, name, literal): nsd_show(ctx, name, literal) -@cli_osm.command(name='nspkg-show', short_help='shows the content of a NSD') +@cli_osm.command(name='nspkg-show', short_help='shows the details of a NS package') @click.option('--literal', is_flag=True, help='print literally, no pretty table') @click.argument('name') @@ -1040,7 +1040,7 @@ def vnfd_show(ctx, name, literal): # exit(1) if literal: - print(yaml.safe_dump(resp)) + print(yaml.safe_dump(resp, indent=4, default_flow_style=False)) return table = PrettyTable(['field', 'value']) @@ -1056,7 +1056,7 @@ def pkg_repo_show(ctx, pkgtype, name, repo, version, filter, literal): resp = ctx.obj.osmrepo.pkg_get(pkgtype, name, repo, version, filter) if literal: - print(yaml.safe_dump(resp)) + print(yaml.safe_dump(resp, indent=4, default_flow_style=False)) return pkgtype += 'd' catalog = pkgtype + '-catalog' @@ -1072,7 +1072,7 @@ def pkg_repo_show(ctx, pkgtype, name, repo, version, filter, literal): table.align = 'l' print(table) -@cli_osm.command(name='vnfd-show', short_help='shows the content of a VNFD') +@cli_osm.command(name='vnfd-show', short_help='shows the details of a NF package') @click.option('--literal', is_flag=True, help='print literally, no pretty table') @click.argument('name') @@ -1086,7 +1086,7 @@ def vnfd_show1(ctx, name, literal): vnfd_show(ctx, name, literal) -@cli_osm.command(name='vnfpkg-show', short_help='shows the content of a VNFD') +@cli_osm.command(name='vnfpkg-show', short_help='shows the details of a NF package') @click.option('--literal', is_flag=True, help='print literally, no pretty table') @click.argument('name') @@ -1099,7 +1099,7 @@ def vnfd_show2(ctx, name, literal): logger.debug("") vnfd_show(ctx, name, literal) -@cli_osm.command(name='vnfpkg-repo-show', short_help='shows the content of a VNFD') +@cli_osm.command(name='vnfpkg-repo-show', short_help='shows the details of a NF package in an OSM repository') @click.option('--literal', is_flag=True, help='print literally, no pretty table') @click.option('--repo', @@ -1121,7 +1121,7 @@ def vnfd_show3(ctx, name, repo, version, literal=None, filter=None): pkg_repo_show(ctx, pkgtype, name, repo, version, filter, literal) -@cli_osm.command(name='nsd-repo-show', short_help='shows the content of a NSD') +@cli_osm.command(name='nsd-repo-show', short_help='shows the details of a NS package in an OSM repository') @click.option('--literal', is_flag=True, help='print literally, no pretty table') @click.option('--repo', @@ -1142,7 +1142,7 @@ def nsd_repo_show(ctx, name, repo, version, literal=None, filter=None): pkgtype = 'ns' pkg_repo_show(ctx, pkgtype, name, repo, version, filter, literal) -@cli_osm.command(name='nspkg-repo-show', short_help='shows the content of a NSD') +@cli_osm.command(name='nspkg-repo-show', short_help='shows the details of a NS package in an OSM repository') @click.option('--literal', is_flag=True, help='print literally, no pretty table') @click.option('--repo', @@ -1163,7 +1163,7 @@ def nsd_repo_show2(ctx, name, repo, version, literal=None, filter=None): pkgtype = 'ns' pkg_repo_show(ctx, pkgtype, name, repo, version, filter, literal) -@cli_osm.command(name='nfpkg-show', short_help='shows the content of a NF Descriptor') +@cli_osm.command(name='nfpkg-show', short_help='shows the details of a NF package') @click.option('--literal', is_flag=True, help='print literally, no pretty table') @click.argument('name') @@ -1177,7 +1177,7 @@ def nfpkg_show(ctx, name, literal): vnfd_show(ctx, name, literal) -@cli_osm.command(name='nfpkg-repo-show', short_help='shows the content of a VNFD') +@cli_osm.command(name='nfpkg-repo-show', short_help='shows the details of a NF package in an OSM repository') @click.option('--literal', is_flag=True, help='print literally, no pretty table') @click.option('--repo', @@ -1218,7 +1218,7 @@ def ns_show(ctx, name, literal, filter): # exit(1) if literal: - print(yaml.safe_dump(ns)) + print(yaml.safe_dump(ns, indent=4, default_flow_style=False)) return table = PrettyTable(['field', 'value']) @@ -1307,7 +1307,7 @@ def vnf_show(ctx, name, literal, filter, kdu): print ("Could not determine KDU status") if literal: - print(yaml.safe_dump(resp)) + print(yaml.safe_dump(resp, indent=4, default_flow_style=False)) return table = PrettyTable(['field', 'value']) @@ -1388,7 +1388,7 @@ def ns_op_show(ctx, id, filter, literal): # exit(1) if literal: - print(yaml.safe_dump(op_info)) + print(yaml.safe_dump(op_info, indent=4, default_flow_style=False)) return table = PrettyTable(['field', 'value']) @@ -1410,7 +1410,7 @@ def nst_show(ctx, name, literal): # exit(1) if literal: - print(yaml.safe_dump(resp)) + print(yaml.safe_dump(resp, indent=4, default_flow_style=False)) return table = PrettyTable(['field', 'value']) @@ -1458,7 +1458,7 @@ def nsi_show(ctx, name, literal, filter): # exit(1) if literal: - print(yaml.safe_dump(nsi)) + print(yaml.safe_dump(nsi, indent=4, default_flow_style=False)) return table = PrettyTable(['field', 'value']) @@ -1564,7 +1564,7 @@ def pdu_show(ctx, name, literal, filter): # exit(1) if literal: - print(yaml.safe_dump(pdu)) + print(yaml.safe_dump(pdu, indent=4, default_flow_style=False)) return table = PrettyTable(['field', 'value']) @@ -3091,7 +3091,7 @@ def k8scluster_list(ctx, filter, literal): check_client_version(ctx.obj, ctx.command.name) resp = ctx.obj.k8scluster.list(filter) if literal: - print(yaml.safe_dump(resp)) + print(yaml.safe_dump(resp, indent=4, default_flow_style=False)) return table = PrettyTable(['Name', 'Id', 'Version', 'VIM', 'K8s-nets', 'Operational State', 'Description']) for cluster in resp: @@ -3118,7 +3118,7 @@ def k8scluster_show(ctx, name, literal): # try: resp = ctx.obj.k8scluster.get(name) if literal: - print(yaml.safe_dump(resp)) + print(yaml.safe_dump(resp, indent=4, default_flow_style=False)) return table = PrettyTable(['key', 'attribute']) for k, v in list(resp.items()): @@ -3259,7 +3259,7 @@ def repo_list(ctx, filter, literal): resp = ctx.obj.repo.list(filter) resp += ctx.obj.osmrepo.list(filter) if literal: - print(yaml.safe_dump(resp)) + print(yaml.safe_dump(resp, indent=4, default_flow_style=False)) return table = PrettyTable(['Name', 'Id', 'Type', 'URI', 'Description']) for repo in resp: @@ -3290,7 +3290,7 @@ def repo_show(ctx, name, literal): if literal: if resp: - print(yaml.safe_dump(resp)) + print(yaml.safe_dump(resp, indent=4, default_flow_style=False)) return table = PrettyTable(['key', 'attribute']) if resp: