modified node parsing to accept ony number of nested strings

This commit is contained in:
Josiah Baldwin
2025-06-14 12:42:59 -07:00
parent 31a8f00cd0
commit 5947e48c5b

View File

@@ -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