Operational state in k8scluster-list 42/8342/1
authorFelipe Vicens <felipe.vicens@atos.net>
Fri, 6 Dec 2019 14:05:07 +0000 (15:05 +0100)
committerFelipe Vicens <felipe.vicens@atos.net>
Fri, 6 Dec 2019 14:05:07 +0000 (15:05 +0100)
Change-Id: I9c00a72fd88a9e66fd292d4117f7506b0b131d8a
Signed-off-by: Felipe Vicens <felipe.vicens@atos.net>
osmclient/scripts/osm.py

index 18b8033..26327fc 100755 (executable)
@@ -2455,11 +2455,11 @@ def k8scluster_list(ctx, filter, literal):
         if literal:
             print(yaml.safe_dump(resp))
             return
-        table = PrettyTable(['Name', 'Id', 'Version', 'VIM', 'K8s-nets', 'Description'])
+        table = PrettyTable(['Name', 'Id', 'Version', 'VIM', 'K8s-nets', 'Operational State', 'Description'])
         for cluster in resp:
             table.add_row([cluster['name'], cluster['_id'], cluster['k8s_version'], cluster['vim_account'],
-                           json.dumps(cluster['nets']), trunc_text(cluster.get('description',''),40)
-                          ])
+                           json.dumps(cluster['nets']), cluster["_admin"]["operationalState"], 
+                           trunc_text(cluster.get('description',''),40)])
         table.align = 'l'
         print(table)
     except ClientException as e: