I believe this was a typo in the past. If a command is run in background and later intr(), kill() or wait() is called on the command the result was saved in never used self._res variable. The ProcessAPI object has self._res_cmd variable that keeps the result of a command. Once the command on background finishes (intr, wait, kill) it should be updated by the collected data from associated intr, wait, kill commands.
Signed-off-by: Jan Tluka jtluka@redhat.com --- lnst/Controller/Task.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/lnst/Controller/Task.py b/lnst/Controller/Task.py index 54c9d3f..6aac332 100644 --- a/lnst/Controller/Task.py +++ b/lnst/Controller/Task.py @@ -670,7 +670,7 @@ class ProcessAPI(object): "type": "wait", "proc_id": self._bg_id, "netns": self._netns} - self._res = self._ctl._run_command(cmd) + self._cmd_res = self._ctl._run_command(cmd)
def intr(self): """ Interrupt the command. """ @@ -679,7 +679,7 @@ class ProcessAPI(object): "type": "intr", "proc_id": self._bg_id, "netns": self._netns} - self._res = self._ctl._run_command(cmd) + self._cmd_res = self._ctl._run_command(cmd)
def kill(self): """ @@ -694,7 +694,7 @@ class ProcessAPI(object): "type": "kill", "proc_id": self._bg_id, "netns": self._netns} - self._res = self._ctl._run_command(cmd) + self._cmd_res = self._ctl._run_command(cmd)
class VolatileValue(object): def __init__(self, func, *args, **kwargs):