From 5947e48c5b507bf21846cdac1d88adc924ac059e Mon Sep 17 00:00:00 2001 From: Josiah Baldwin Date: Sat, 14 Jun 2025 12:42:59 -0700 Subject: [PATCH] modified node parsing to accept ony number of nested strings --- src/meshctrl/session.py | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/src/meshctrl/session.py b/src/meshctrl/session.py index 9981935..110f62a 100644 --- a/src/meshctrl/session.py +++ b/src/meshctrl/session.py @@ -479,11 +479,13 @@ class Session(object): raise exceptions.ServerError(res0["result"]) if details: try: - raw_data = res0["data"] - if isinstance(raw_data, str): - nodes = json.loads(raw_data) - else: - nodes = raw_data + nodes = res0["data"] + # Accept any number of nested strings, meshcentral is odd + while True: + try: + nodes = json.loads(nodes) + except TypeError: + break except Exception as e: print(f"Failed to parse device data: {e}") return