mirror of
https://github.com/AlbrechtL/openwrt-docker.git
synced 2026-10-14 16:01:29 +00:00
Increase test stability again.
This commit is contained in:
@@ -107,8 +107,15 @@ def run_openwrt_shell_command(command, *arg):
|
||||
if process.stdout == "":
|
||||
return None
|
||||
|
||||
# Sometime it happens that also the previous command return is included which results in two or more json strings.
|
||||
jsons = process.stdout.split('\n')
|
||||
|
||||
# Search for 'return' and give back the last occurrence index
|
||||
idx = next((i for i, s in reversed(list(enumerate(jsons))) if 'return' in s), -1)
|
||||
|
||||
# Assume json here, parse it
|
||||
ret = json.loads(process.stdout)
|
||||
ret = json.loads(jsons[idx])
|
||||
|
||||
data = ret['return']
|
||||
|
||||
# decode output
|
||||
|
||||
Reference in New Issue
Block a user