diff --git a/novaclient/tests/unit/v2/test_services.py b/novaclient/tests/unit/v2/test_services.py index 0c0434afd..ddc75eeb1 100644 --- a/novaclient/tests/unit/v2/test_services.py +++ b/novaclient/tests/unit/v2/test_services.py @@ -34,18 +34,11 @@ class ServicesTest(utils.TestCase): svs = self.cs.services.list() self.assert_request_id(svs, fakes.FAKE_REQUEST_ID_LIST) self.cs.assert_called('GET', '/os-services') - expect_uuid_id = ( - api_versions.APIVersion(self.api_version) >= - api_versions.APIVersion('2.53')) for s in svs: self.assertIsInstance(s, self._get_service_type()) self.assertEqual('nova-compute', s.binary) self.assertEqual('host1', s.host) - if expect_uuid_id: - stringified = '' % s.id - else: - stringified = '' % s.binary - self.assertEqual(stringified, str(s)) + self.assertEqual('' % s.id, str(s)) def test_list_services_with_hostname(self): svs = self.cs.services.list(host='host2') diff --git a/novaclient/v2/services.py b/novaclient/v2/services.py index 3fe877d32..f3d1255dc 100644 --- a/novaclient/v2/services.py +++ b/novaclient/v2/services.py @@ -20,15 +20,10 @@ from six.moves import urllib from novaclient import api_versions from novaclient import base -from novaclient import utils class Service(base.Resource): def __repr__(self): - # If the id is int-like, then represent the service using it's binary - # name, otherwise use the UUID ID. - if utils.is_integer_like(self.id): - return "" % self.binary return "" % self.id def _add_details(self, info):