Risk: Low
Visibility: All people raising CmdError exceptions
The CmdError exception was defined in such a way that it needs to format
the exit code of the failed command as an integer. However, by mistake,
the whole result object was being passed to the format string, hence
raising a ValueError. This patch fixes the problem by passing only the
exit code attribute of the result object to the format string operation.
Signed-off-by: Lucas Meneghel Rodrigues <lucasmr@br.ibm.com>
git-svn-id: http://test.kernel.org/svn/autotest/trunk@1634 592f7852-d20e-0410-864c-8624ca9c26a4
diff --git a/client/common_lib/error.py b/client/common_lib/error.py
index f1cc010..6eeb3fe 100644
--- a/client/common_lib/error.py
+++ b/client/common_lib/error.py
@@ -56,7 +56,7 @@
def __str__(self):
msg = "Command <%s> failed, rc=%d" % (self.args[0],
- self.args[1])
+ self.args[1].exit_status)
if self.args[2]:
msg += ", " + self.args[2]
return msg