Remove get_service_by_instance
k8s is a logic concept and it does not bind to any instance Change-Id: I4bfb1940c681a133d6a5257c3abe2a8661fca67b
This commit is contained in:
parent
f1fbce758d
commit
b10d2cbbc1
|
@ -664,14 +664,6 @@ class Connection(object):
|
|||
:returns: A service.
|
||||
"""
|
||||
|
||||
@abc.abstractmethod
|
||||
def get_service_by_instance(self, instance):
|
||||
"""Return a service.
|
||||
|
||||
:param instance: The instance name or uuid to search for.
|
||||
:returns: A service.
|
||||
"""
|
||||
|
||||
@abc.abstractmethod
|
||||
def destroy_service(self, service_id):
|
||||
"""Destroy a service and all associated interfaces.
|
||||
|
|
|
@ -1120,20 +1120,6 @@ class Connection(api.Connection):
|
|||
except NoResultFound:
|
||||
raise exception.ServiceNotFound(bay=bay_uuid)
|
||||
|
||||
def get_service_by_instance(self, instance):
|
||||
if not utils.is_uuid_like(instance):
|
||||
raise exception.InvalidUUID(uuid=instance)
|
||||
|
||||
query = (model_query(models.Service)
|
||||
.filter_by(instance_uuid=instance))
|
||||
|
||||
try:
|
||||
result = query.one()
|
||||
except NoResultFound:
|
||||
raise exception.InstanceNotFound(instance=instance)
|
||||
|
||||
return result
|
||||
|
||||
def destroy_service(self, service_id):
|
||||
session = get_session()
|
||||
with session.begin():
|
||||
|
|
Loading…
Reference in New Issue