Minor fix in error_details, only shown for BROKEN or DEGRADED or old client versions 05/9005/3
authorgarciadeblas <gerardo.garciadeblas@telefonica.com>
Fri, 29 May 2020 15:00:49 +0000 (15:00 +0000)
committerbeierlm <mark.beierl@canonical.com>
Wed, 17 Jun 2020 18:39:30 +0000 (20:39 +0200)
Change-Id: I49b382204b41a7b7dc36753c351deaaf520d2a05
Signed-off-by: garciadeblas <gerardo.garciadeblas@telefonica.com>
osmclient/scripts/osm.py

index 78f7896..a369c48 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'])