From 3fa1ca2e32f41f7f35deb8f0e053a767ff1afa59 Mon Sep 17 00:00:00 2001 From: Josiah Baldwin Date: Wed, 22 Oct 2025 19:59:17 -0700 Subject: [PATCH] Added handling for weird response from meshcentral for run_command and run_console_command --- src/meshctrl/session.py | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/src/meshctrl/session.py b/src/meshctrl/session.py index 63d40a5..a554a87 100644 --- a/src/meshctrl/session.py +++ b/src/meshctrl/session.py @@ -1570,6 +1570,11 @@ class Session(object): result = reply_result console_task.cancel() tasks.append(reply_task) + else: + if not ignore_output: + console_task.cancel() + reply_task.cancel() + raise exceptions.ServerError(f"Unrecognized response: {data}") tasks = [] async with asyncio.TaskGroup() as tg: @@ -1647,6 +1652,9 @@ class Session(object): tasks.append(console_task) else: console_task.cancel() + else: + console_task.cancel() + raise exceptions.ServerError(f"Unrecognized response: {data}") tasks = [] async with asyncio.TaskGroup() as tg: