Merge "fix host resource repr to use 'host' attribute"

This commit is contained in:
Jenkins
2014-07-31 07:09:45 +00:00
committed by Gerrit Code Review
2 changed files with 5 additions and 1 deletions

View File

@@ -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('<Host: dummy>', repr(hs[0]))

View File

@@ -21,7 +21,7 @@ from novaclient import base
class Host(base.Resource):
def __repr__(self):
return "<Host: %s>" % self.host_name
return "<Host: %s>" % self.host
def _add_details(self, info):
dico = 'resource' in info and info['resource'] or info