From 30d1d518d5ae721871c6f813bb4d9e7d84a097fe Mon Sep 17 00:00:00 2001 From: Zack Cerza Date: Fri, 9 May 2014 11:27:23 -0500 Subject: [PATCH] Make Remote.shortname actually short Signed-off-by: Zack Cerza --- teuthology/orchestra/remote.py | 7 ++----- teuthology/orchestra/test/test_remote.py | 4 ++-- 2 files changed, 4 insertions(+), 7 deletions(-) diff --git a/teuthology/orchestra/remote.py b/teuthology/orchestra/remote.py index a9dd3595638f6..63fce9ddca0a1 100644 --- a/teuthology/orchestra/remote.py +++ b/teuthology/orchestra/remote.py @@ -63,12 +63,9 @@ class Remote(object): @property def shortname(self): - """ - shortname decorator - """ name = self._shortname if name is None: - name = self.name + name = self.hostname.split('.')[0] return name @property @@ -93,7 +90,7 @@ class Remote(object): return misc.get_system_type(self) def __str__(self): - return self.shortname + return self.name def __repr__(self): return '{classname}(name={name!r})'.format( diff --git a/teuthology/orchestra/test/test_remote.py b/teuthology/orchestra/test/test_remote.py index 25f14fc84685c..663009b2e4317 100644 --- a/teuthology/orchestra/test/test_remote.py +++ b/teuthology/orchestra/test/test_remote.py @@ -13,14 +13,14 @@ class TestRemote(object): ssh=fudge.Fake('SSHConnection'), ) assert r.shortname == 'xyz' - assert str(r) == 'xyz' + assert str(r) == 'jdoe@xyzzy.example.com' def test_shortname_default(self): r = remote.Remote( name='jdoe@xyzzy.example.com', ssh=fudge.Fake('SSHConnection'), ) - assert r.shortname == 'jdoe@xyzzy.example.com' + assert r.shortname == 'xyzzy' assert str(r) == 'jdoe@xyzzy.example.com' @fudge.with_fakes -- 2.39.5