From: Ondrej Lichtner <olichtne(a)redhat.com>
This commit changes the names in the class NetTestCommandContext.
Previously the class was only used for background commands.
But since all of our test will now run in the background I renamed the
methods to something more appropriate.
Signed-off-by: Ondrej Lichtner <olichtne(a)redhat.com>
---
lnst/Common/NetTestCommand.py | 24 +++++++++++++-----------
1 file changed, 13 insertions(+), 11 deletions(-)
diff --git a/lnst/Common/NetTestCommand.py b/lnst/Common/NetTestCommand.py
index a88c76f..3fd6ac4 100644
--- a/lnst/Common/NetTestCommand.py
+++ b/lnst/Common/NetTestCommand.py
@@ -172,27 +172,29 @@ class NetTestCommandContext:
def __init__(self):
self._dict = {}
- def add_bg_cmd(self, bg_cmd):
- self._dict[bg_cmd.get_bg_id()] = bg_cmd
+ def add_cmd(self, cmd):
+ self._dict[cmd.get_id()] = cmd
- def del_bg_cmd(self, bg_cmd):
- del self._dict[bg_cmd.get_bg_id()]
+ def del_cmd(self, cmd):
+ del self._dict[cmd.get_id()]
- def get_bg_cmd(self, bg_id):
- return self._dict[bg_id]
+ def get_cmd(self, id):
+ return self._dict[id]
- def _kill_all_bg_cmds(self):
- for bg_id in self._dict:
- self._dict[bg_id].kill()
+ def _kill_all_cmds(self):
+ for id in self._dict:
+ self._dict[id].kill()
def cleanup(self):
- self._kill_all_bg_cmds()
+ self._kill_all_cmds()
self._dict = {}
def get_read_pipes(self):
pipes = {}
for key in self._dict:
- pipes[key] = self._dict[key].get_connection_pipe()
+ pipe = self._dict[key].get_connection_pipe()
+ if pipe != None:
+ pipes[key] = pipe
return pipes
def NetTestCommandTest(command, resource_table):
--
1.7.11.7