commit e500bfc513b6024b81b4be1618153bcceb936258
Author: Ondrej Lichtner <olichtne(a)redhat.com>
Date: Tue Sep 9 15:59:27 2014 +0200
Machine: fix use of get_remaining_time method call
If the background command was running in a non-root network namespace,
the method call would fail. This commit fixes that problem.
Signed-off-by: Ondrej Lichtner <olichtne(a)redhat.com>
Signed-off-by: Jiri Pirko <jiri(a)resnulli.us>
lnst/Controller/Machine.py | 8 +++++++-
1 files changed, 7 insertions(+), 1 deletions(-)
---
diff --git a/lnst/Controller/Machine.py b/lnst/Controller/Machine.py
index 62a23e3..33d1795 100644
--- a/lnst/Controller/Machine.py
+++ b/lnst/Controller/Machine.py
@@ -258,7 +258,13 @@ class Machine(object):
if command["type"] == "wait":
logging.debug("Get remaining time of bg process with bg_id == %s"
% command["proc_id"])
- remaining_time = self._rpc_call("get_remaining_time",
command["proc_id"])
+ if command["netns"] != None:
+ remaining_time = self._rpc_call_to_netns(command["netns"],
+ "get_remaining_time",
+ command["proc_id"])
+ else:
+ remaining_time = self._rpc_call("get_remaining_time",
+ command["proc_id"])
logging.debug("Setting timeout to %d", remaining_time)
if remaining_time > 0:
signal.alarm(remaining_time)
Show replies by date