From b5394228ef415f03c01c0d5c3325fab09901cf14 Mon Sep 17 00:00:00 2001 From: Arksine Date: Mon, 28 Dec 2020 17:11:59 -0500 Subject: [PATCH] shell_command: reset tracking attributes in run() Clear partial output and cancelled attributes prior to each call of run(). This allows a command to be cleanly run again after a failure. 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 8ec43bc..5f21388 100644 --- a/moonraker/plugins/shell_command.py +++ b/moonraker/plugins/shell_command.py @@ -46,6 +46,8 @@ class ShellCommand: async def run(self, timeout=2., verbose=True): self.return_code = fd = None + self.partial_output = b"" + self.cancelled = False if timeout is None: # Never timeout timeout = 9999999999999999.