Remove get_service method from compute
If a get_service method is called with a valid service id, then it raises ResourceNotFound exception as this API is not implemented in nova. Removed this method and related test cases to cleanup the code. Closes-Bug: #1697687 Change-Id: I4086f4731fc653d721fe879b718b117327460933
This commit is contained in:
parent
54334fd6f0
commit
bdd048e76c
|
@ -103,7 +103,6 @@ Service Operations
|
|||
|
||||
.. autoclass:: openstack.compute.v2._proxy.Proxy
|
||||
|
||||
.. automethod:: openstack.compute.v2._proxy.Proxy.get_service
|
||||
.. automethod:: openstack.compute.v2._proxy.Proxy.services
|
||||
.. automethod:: openstack.compute.v2._proxy.Proxy.enable_service
|
||||
.. automethod:: openstack.compute.v2._proxy.Proxy.disable_service
|
||||
|
|
|
@ -1056,20 +1056,6 @@ class Proxy(proxy2.BaseProxy):
|
|||
"""
|
||||
return self._get(_hypervisor.Hypervisor, hypervisor)
|
||||
|
||||
def get_service(self, service):
|
||||
"""Get a single service
|
||||
|
||||
:param service: The value can be the ID of a serivce or a
|
||||
:class:`~openstack.compute.v2.service.Service`
|
||||
instance.
|
||||
|
||||
:returns:
|
||||
A :class:`~openstack.compute.v2.serivce.Service` object.
|
||||
:raises: :class:`~openstack.exceptions.ResourceNotFound`
|
||||
when no resource can be found.
|
||||
"""
|
||||
return self._get(_service.Service, service)
|
||||
|
||||
def force_service_down(self, service, host, binary):
|
||||
"""Force a service down
|
||||
|
||||
|
|
|
@ -23,7 +23,6 @@ class Service(resource2.Resource):
|
|||
service = compute_service.ComputeService()
|
||||
|
||||
# capabilities
|
||||
allow_get = True
|
||||
allow_list = True
|
||||
allow_update = True
|
||||
|
||||
|
|
|
@ -471,10 +471,6 @@ class TestComputeProxy(test_proxy_base2.TestProxyBase):
|
|||
self.verify_get(self.proxy.get_hypervisor,
|
||||
hypervisor.Hypervisor)
|
||||
|
||||
def test_get_service(self):
|
||||
self.verify_get(self.proxy.get_service,
|
||||
service.Service)
|
||||
|
||||
def test_services(self):
|
||||
self.verify_list_no_kwargs(self.proxy.services,
|
||||
service.Service,
|
||||
|
|
|
@ -42,9 +42,9 @@ class TestService(testtools.TestCase):
|
|||
self.assertEqual('services', sot.resources_key)
|
||||
self.assertEqual('/os-services', sot.base_path)
|
||||
self.assertEqual('compute', sot.service.service_type)
|
||||
self.assertTrue(sot.allow_get)
|
||||
self.assertTrue(sot.allow_update)
|
||||
self.assertTrue(sot.allow_list)
|
||||
self.assertFalse(sot.allow_get)
|
||||
|
||||
def test_make_it(self):
|
||||
sot = service.Service(**EXAMPLE)
|
||||
|
|
Loading…
Reference in New Issue