Some fixes and minor cleanups as suggested by PyLint.
Signed-off-by: Jeremy Orlow <jorlow@google.com>
git-svn-id: http://test.kernel.org/svn/autotest/trunk@1745 592f7852-d20e-0410-864c-8624ca9c26a4
diff --git a/client/common_lib/error.py b/client/common_lib/error.py
index 0950232..2423442 100644
--- a/client/common_lib/error.py
+++ b/client/common_lib/error.py
@@ -73,13 +73,16 @@
"""
def __init__(self, command, result_obj, additional_text=None):
TestError.__init__(self, command, result_obj, additional_text)
+ self.command = command
+ self.result_obj = result_obj
+ self.additional_text = additional_text
def __str__(self):
- msg = "Command <%s> failed, rc=%d" % (self.args[0],
- self.args[1].exit_status)
- if self.args[2]:
- msg += ", " + self.args[2]
+ msg = "Command <%s> failed, rc=%d" % (self.command,
+ self.result_obj.exit_status)
+ if self.additional_text:
+ msg += ", " + self.additional_text
return msg
diff --git a/client/common_lib/test.py b/client/common_lib/test.py
index 750fc3a..fedaa11 100644
--- a/client/common_lib/test.py
+++ b/client/common_lib/test.py
@@ -114,6 +114,11 @@
pass
+ def execute(self):
+ raise NotImplementedError("This function must be overriden by "
+ "the test class")
+
+
def _exec(self, args, dargs):
try:
self.job.stdout.tee_redirect(
@@ -173,7 +178,7 @@
f.close()
print name + ": installing test url=" + url
- get_file(url, os.path.join(group_dir, 'test.tgz'))
+ utils.get_file(url, os.path.join(group_dir, 'test.tgz'))
old_wd = os.getcwd()
os.chdir(group_dir)
tar = tarfile.open('test.tgz')