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 <arksine.code@gmail.com>
This commit is contained in:
Arksine 2020-12-28 17:11:59 -05:00
parent 6bf4ef8b00
commit b5394228ef
1 changed files with 2 additions and 0 deletions

View File

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