Fix bug 1265: fix error in k8scluster-list with helm and juju opState
[osm/osmclient.git] / osmclient / scripts / osm.py
index 227e429..9523965 100755 (executable)
@@ -605,7 +605,7 @@ def nfpkg_list(ctx, nf_type, filter, long):
 
 
 @cli_osm.command(name='vnfpkg-repo-list', short_help='list all xNF from OSM repositories')
-@click.option('--filter', default=None,
+@click.option('--filter', default=None, multiple=True,
               help='restricts the list to the NFpkg matching the filter')
 @click.option('--repo', default=None,
               help='restricts the list to a particular OSM repository')
@@ -617,7 +617,7 @@ def nfpkg_repo_list1(ctx, filter, repo, long):
     pkg_repo_list(ctx, pkgtype, filter, repo, long)
 
 @cli_osm.command(name='nfpkg-repo-list', short_help='list all xNF from OSM repositories')
-@click.option('--filter', default=None,
+@click.option('--filter', default=None, multiple=True,
               help='restricts the list to the NFpkg matching the filter')
 @click.option('--repo', default=None,
               help='restricts the list to a particular OSM repository')
@@ -3155,14 +3155,14 @@ def k8scluster_list(ctx, filter, literal, long):
     except:
         vim_list = []
     for cluster in resp:
+        logger.debug('Cluster details: {}'.format(yaml.safe_dump(cluster)))
         vim_name = get_vim_name(vim_list, cluster['vim_account'])
         #vim_info = '{} ({})'.format(vim_name,cluster['vim_account'])
         vim_info = vim_name
         op_state_details = "Helm: {}\nJuju: {}".format(
-                           cluster["_admin"].get("helm-chart", "-").get("operationalState", "-"),
-                           cluster["_admin"].get("juju-bundle", "-").get("operationalState", "-"))
+                           cluster["_admin"].get("helm-chart", {}).get("operationalState", "-"),
+                           cluster["_admin"].get("juju-bundle", {}).get("operationalState", "-"))
         if long:
-            logger.debug('Cluster details: {}'.format(yaml.safe_dump(cluster)))
             project_id, project_name = get_project(project_list, cluster)
             #project_info = '{} ({})'.format(project_name, project_id)
             project_info = project_name