diff --git a/novaclient/tests/v1_1/test_hosts.py b/novaclient/tests/v1_1/test_hosts.py index d8291c6ae..8fcdf5a76 100644 --- a/novaclient/tests/v1_1/test_hosts.py +++ b/novaclient/tests/v1_1/test_hosts.py @@ -78,3 +78,7 @@ class HostsTest(utils.FixturedTestCase): host.shutdown() self.assert_called( 'GET', '/os-hosts/sample_host/shutdown') + + def test_hosts_repr(self): + hs = self.cs.hosts.get('host') + self.assertEqual('', repr(hs[0])) diff --git a/novaclient/v1_1/hosts.py b/novaclient/v1_1/hosts.py index 0b641d44c..af1756ad2 100644 --- a/novaclient/v1_1/hosts.py +++ b/novaclient/v1_1/hosts.py @@ -21,7 +21,7 @@ from novaclient import base class Host(base.Resource): def __repr__(self): - return "" % self.host_name + return "" % self.host def _add_details(self, info): dico = 'resource' in info and info['resource'] or info