commit b65cb9fd368a5240dc79f3e38d12bd862ea4c425
Author: Radek Pazdera <rpazdera(a)redhat.com>
Date: Mon Jun 24 15:49:26 2013 +0200
NetTestSlave: Removing double exception handling
Due to several changes in the communication channel between controller
and the slaves, the NetTestSlave class was handling (and logging)
exceptions twice.
This patch removes the first unnecessary processing, so only a single
traceback is logged.
Signed-off-by: Radek Pazdera <rpazdera(a)redhat.com>
Signed-off-by: Jiri Pirko <jiri(a)resnulli.us>
lnst/Slave/NetTestSlave.py | 44 ++++++++++++++++++--------------------------
1 files changed, 18 insertions(+), 26 deletions(-)
---
diff --git a/lnst/Slave/NetTestSlave.py b/lnst/Slave/NetTestSlave.py
index d2dd484..f3a321a 100644
--- a/lnst/Slave/NetTestSlave.py
+++ b/lnst/Slave/NetTestSlave.py
@@ -211,32 +211,24 @@ class SlaveMethods:
return True
def run_command(self, command):
- try:
- cmd = NetTestCommand(self._command_context, command,
- self._resource_table, self._log_ctl)
- self._command_context.add_cmd(cmd)
-
- res = cmd.run()
- if not cmd.forked():
- self._command_context.del_cmd(cmd)
-
- if command["type"] == "system_config":
- if res["passed"]:
-
self._update_system_config(res["res_data"]["options"],
- command["persistent"])
- else:
- err = "Error occured while setting system "\
- "configuration (%s)" % res["err_msg"]
- logging.error(err)
-
- return res
- except:
- log_exc_traceback()
- cmd_type = command["type"]
- m_id = command["machine_id"]
- msg = "Execution of %s command on machine %s failed" \
- % (cmd_type, m_id)
- raise CommandException(msg)
+ cmd = NetTestCommand(self._command_context, command,
+ self._resource_table, self._log_ctl)
+ self._command_context.add_cmd(cmd)
+
+ res = cmd.run()
+ if not cmd.forked():
+ self._command_context.del_cmd(cmd)
+
+ if command["type"] == "system_config":
+ if res["passed"]:
+
self._update_system_config(res["res_data"]["options"],
+ command["persistent"])
+ else:
+ err = "Error occured while setting system "\
+ "configuration (%s)" % res["err_msg"]
+ logging.error(err)
+
+ return res
def machine_cleanup(self):
NetConfigDeviceAllCleanup()
Show replies by date