diff options
author | Masayuki Igawa <igawa@mxs.nes.nec.co.jp> | 2014-02-04 15:53:16 +0900 |
---|---|---|
committer | Masayuki Igawa <igawa@mxs.nes.nec.co.jp> | 2014-02-05 13:31:33 +0900 |
commit | 5e3a3a193bb55cd9f0622b0adb76ffa54b98b906 (patch) | |
tree | 75f6d4e95f4cc906538e61c992276d1c161a7a61 /novaclient/tests/v1_1 | |
parent | 810857849ed32773c38df12785715f89d33e83af (diff) | |
download | python-novaclient-5e3a3a193bb55cd9f0622b0adb76ffa54b98b906.tar.gz |
Fix Serivce class AttributeError
When we str(service_object), an AttributeError occurred like this:
========================
File "/opt/stack/python-novaclient/novaclient/v1_1/services.py", line
24, in __repr__
return "<Service: %s>" % self.service
File
"/opt/stack/python-novaclient/novaclient/openstack/common/apiclient/base.py",
line 463, in __getattr__
raise AttributeError(k)
AttributeError: service
========================
This commit fixes it.
Change-Id: I496d522591273bf1b1e7dbadf19afaf5e64e41e3
Closes-Bug: #1276408
Diffstat (limited to 'novaclient/tests/v1_1')
-rw-r--r-- | novaclient/tests/v1_1/test_services.py | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/novaclient/tests/v1_1/test_services.py b/novaclient/tests/v1_1/test_services.py index 36f82e40..d66a1110 100644 --- a/novaclient/tests/v1_1/test_services.py +++ b/novaclient/tests/v1_1/test_services.py @@ -37,6 +37,7 @@ class ServicesTest(utils.TestCase): self.assertIsInstance(s, self._get_service_type()) self.assertEqual(s.binary, 'nova-compute') self.assertEqual(s.host, 'host1') + self.assertTrue(str(s).startswith('<Service: ')) def test_list_services_with_hostname(self): svs = self.cs.services.list(host='host2') |