From 0f3808c91298144341f0142088be7b2f656f8570 Mon Sep 17 00:00:00 2001 From: garciadeblas Date: Fri, 29 May 2020 15:00:49 +0000 Subject: [PATCH] Minor fix in error_details, only shown for BROKEN or DEGRADED or old client versions Change-Id: I49b382204b41a7b7dc36753c351deaaf520d2a05 Signed-off-by: garciadeblas --- osmclient/scripts/osm.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/osmclient/scripts/osm.py b/osmclient/scripts/osm.py index 8dbf2b6..d4e2a38 100755 --- a/osmclient/scripts/osm.py +++ b/osmclient/scripts/osm.py @@ -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']) -- 2.25.1