Thu, Aug 06, 2015 at 11:44:48AM CEST, jtluka(a)redhat.com wrote:
Thu, Aug 06, 2015 at 09:00:32AM CEST, olichtne(a)redhat.com wrote:
>From: Ondrej Lichtner <olichtne(a)redhat.com>
>
>If a command was running in a network namespace and timed out, the
>kill_command rpc request was sent to the main lnst-slave process instead
>of the netns one. This commit fixes that.
>
>Signed-off-by: Ondrej Lichtner <olichtne(a)redhat.com>
>---
> lnst/Controller/Machine.py | 16 +++++++++++++---
> 1 file changed, 13 insertions(+), 3 deletions(-)
>
>diff --git a/lnst/Controller/Machine.py b/lnst/Controller/Machine.py
>index c360e6c..8a40ceb 100644
>--- a/lnst/Controller/Machine.py
>+++ b/lnst/Controller/Machine.py
>@@ -302,10 +302,20 @@ class Machine(object):
> else:
> cmd_res = self._rpc_call("run_command", command)
> except MachineError as exc:
>- if "proc_id" in command:
>- cmd_res = self._rpc_call("kill_command",
command["proc_id"])
>+ if command["netns"] is not None:
>+ netns = command["netns"]
>+ if "proc_id" in command:
>+ cmd_res = self._rpc_call_to_netns(netns,
"kill_command",
>+ command["proc_id"])
>+ else:
>+ cmd_res = self._rpc_call_to_netns(netns,
"kill_command",
>+ None)
Why we need the None version? What would be killed if None is passed as
parameter?
Oh, so there are subsequent patches in the series that explains this.
Looks ok.
> else:
>- cmd_res = self._rpc_call("kill_command", None)
>+ if "proc_id" in command:
>+ cmd_res = self._rpc_call("kill_command",
command["proc_id"])
>+ else:
>+ cmd_res = self._rpc_call("kill_command", None)
>+
> cmd_res["passed"] = False
> cmd_res["msg"] = str(exc)
>
>--
>2.5.0
>
>_______________________________________________
>LNST-developers mailing list
>LNST-developers(a)lists.fedorahosted.org
>https://lists.fedorahosted.org/mailman/listinfo/lnst-developers