From 22a5f6720cd382babc4d01d33620815ce2da3684 Mon Sep 17 00:00:00 2001 From: Arksine Date: Wed, 3 Mar 2021 07:52:57 -0500 Subject: [PATCH] shell_command: reset internal proc state in "run_with_response" This sets a clean state should a shell command be run more than once. Signed-off-by: Eric Callahan --- moonraker/plugins/shell_command.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/moonraker/plugins/shell_command.py b/moonraker/plugins/shell_command.py index 41c7ff9..1852020 100644 --- a/moonraker/plugins/shell_command.py +++ b/moonraker/plugins/shell_command.py @@ -107,6 +107,8 @@ class ShellCommand: return self._check_proc_success(complete) async def run_with_response(self, timeout=2., retries=1): + self.return_code = self.proc = None + self.cancelled = False while retries > 0: stdout = stderr = None if await self._create_subprocess():