Skip to content

Commit

Permalink
Merge pull request #235 from canonical/commandrunner-ensure-process-none
Browse files Browse the repository at this point in the history
Ensure self.process is None in CommandRunner in case it's reused
  • Loading branch information
plars authored Mar 24, 2024
2 parents 9faa0df + c4df5d0 commit 10d680d
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions agent/testflinger_agent/runner.py
Original file line number Diff line number Diff line change
Expand Up @@ -87,6 +87,8 @@ def cleanup(self):
self.process.kill()

def run(self, cmd: str) -> int:
# Ensure that the process is None before starting
self.process = None

signal.signal(signal.SIGTERM, lambda signum, frame: self.cleanup())

Expand Down

0 comments on commit 10d680d

Please sign in to comment.