Add a slightly friendlier repr for remote hosts. Since these objects
are often passed in as parameters to tests the repr will often
show up in test keyvals (where we log all params).
Risk: Low
Visibility: Eliminates the (generally unhelpful) default repr for
host objects.
Signed-off-by: John Admanski <jadmanski@google.com>
git-svn-id: http://test.kernel.org/svn/autotest/trunk@3168 592f7852-d20e-0410-864c-8624ca9c26a4
diff --git a/server/hosts/remote.py b/server/hosts/remote.py
index 2a80395..286fbd9 100644
--- a/server/hosts/remote.py
+++ b/server/hosts/remote.py
@@ -34,6 +34,10 @@
self.tmp_dirs = []
+ def __repr__(self):
+ return "<remote host: %s>" % self.hostname
+
+
def close(self):
super(RemoteHost, self).close()
self.stop_loggers()