From 43ce6c900fbb94e8a3c630f3970f9aa6bbeb12b4 Mon Sep 17 00:00:00 2001 From: Ivan Hrasko Date: Thu, 11 Oct 2018 14:36:20 +0200 Subject: [PATCH] SXP: Do not parse missing connections list - after upgrade to Neon platform empty lists are removed from datastore - this is also case for connections list - do not try to parse it if its missing Change-Id: I04a3695ecd76d3a13b1abee7e5b36738433dd759 Signed-off-by: Ivan Hrasko --- csit/libraries/Sxp.py | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/csit/libraries/Sxp.py b/csit/libraries/Sxp.py index e873b73b48..644eae7387 100644 --- a/csit/libraries/Sxp.py +++ b/csit/libraries/Sxp.py @@ -414,11 +414,13 @@ def parse_connections(connections_json): """ data = json.loads(connections_json) - connections = data['output']['connections'] - output = [] - for connection in connections.values(): - output += connection - return output + output = data['output'] + result = [] + if output: + connections = output['connections'] + for connection in connections.values(): + result += connection + return result def find_connection(connections_json, version, mode, ip, port, state): -- 2.36.6