Minor fix in error_details, only shown for BROKEN or DEGRADED or old client versions 65/9065/1
authorgarciadeblas <gerardo.garciadeblas@telefonica.com>
Fri, 29 May 2020 15:00:49 +0000 (15:00 +0000)
committergarciadeblas <gerardo.garciadeblas@telefonica.com>
Wed, 10 Jun 2020 10:54:58 +0000 (10:54 +0000)
Change-Id: I49b382204b41a7b7dc36753c351deaaf520d2a05
Signed-off-by: garciadeblas <gerardo.garciadeblas@telefonica.com>
osmclient/scripts/osm.py

index 8dbf2b6..d4e2a38 100755 (executable)
@@ -368,7 +368,8 @@ def ns_list(ctx, filter, long):
             else:
                 current_operation = "{} ({})".format(nsr['_admin'].get('current-operation','-'), nsr['_admin']['nslcmop'])
             error_details = "N/A"
-            if ns_state == "BROKEN" or ns_state == "DEGRADED" or nsr.get('errorDescription'):
+            if ns_state == "BROKEN" or ns_state == "DEGRADED" or \
+                ('currentOperation' not in nsr and nsr.get('errorDescription')):
                 error_details = "{}\nDetail: {}".format(nsr['errorDescription'], nsr['errorDetail'])
         else:
             nsopdata = ctx.obj.ns.get_opdata(ns['id'])