From: Ondrej Lichtner <olichtne(a)redhat.com>
Using the repr() of the _what object instance should lead to a more
comprehensive description of what the job is, especially for jobs that
execute a test module.
I also moved this to the end of the generated string since this is the
field with most length variance, this way it makes the line formatting
more consistent when multiple jobs are printed under each other.
Signed-off-by: Ondrej Lichtner <olichtne(a)redhat.com>
---
lnst/Controller/Job.py | 7 ++-----
1 file changed, 2 insertions(+), 5 deletions(-)
diff --git a/lnst/Controller/Job.py b/lnst/Controller/Job.py
index 908986c..22814e6 100644
--- a/lnst/Controller/Job.py
+++ b/lnst/Controller/Job.py
@@ -218,15 +218,12 @@ def _to_dict(self):
def __str__(self):
attrs = ["type(%s)" % self.type]
- if self._type == "module":
- attrs.append("module(%s)" % self._what.__class__.__name__)
- elif self._type == "shell":
- attrs.append("command(%s)" % self._what)
-
if self._netns is not None:
attrs.append("netns(%s)" % self._netns.name)
if not self._expect:
attrs.append("expecting FAIL")
+ attrs.append(repr(self._what))
+
return ", ".join(attrs)
--
2.21.0