Remove unused DB API get_rcs_by_bay_uuid

Remove unused DB API 'get_rcs_by_bay_uuid' and associated unit
tests. There are no consumers of this API in its current state of
art. Cleaning up dead code.

Also, added a related bug which will serve as a placeholder
to re-add the removed code, if needed in future.

Closes-Bug: #1489570
Related-Bug: #1499121

Change-Id: I7c91323e53d7f60a93876197ac1886f8e086d173
This commit is contained in:
Vilobh Meshram 2015-08-27 12:39:27 -07:00
parent 6c43071d3f
commit 31dcba92cb
3 changed files with 0 additions and 29 deletions

View File

@ -593,14 +593,6 @@ class Connection(object):
:returns: A list of tuples of the specified columns.
"""
@abc.abstractmethod
def get_rcs_by_bay_uuid(self, bay_uuid):
"""List all the ReplicationControllers for a given bay.
:param bay_uuid: The uuid of a bay.
:returns: A list of ReplicationControllers.
"""
@abc.abstractmethod
def create_rc(self, values):
"""Create a new ReplicationController.

View File

@ -881,16 +881,6 @@ class Connection(api.Connection):
except NoResultFound:
raise exception.ReplicationControllerNotFound(rc=rc_uuid)
def get_rcs_by_bay_uuid(self, context, bay_uuid):
# First verify whether the Bay exists
self.get_bay_by_uuid(context, bay_uuid)
query = model_query(models.ReplicationController).filter_by(
bay_uuid=bay_uuid)
try:
return query.all()
except NoResultFound:
raise exception.ReplicationControllerNotFound(bay=bay_uuid)
def get_rc_by_name(self, context, rc_name):
query = model_query(models.ReplicationController)
query = self._add_tenant_filters(context, query)

View File

@ -105,17 +105,6 @@ class DbRCTestCase(base.DbTestCase):
'bay_uuid': magnum_utils.generate_uuid()})
self.assertEqual(0, len(rc))
def test_get_rcs_by_bay_uuid(self):
rc = self.dbapi.get_rcs_by_bay_uuid(self.context,
self.bay.uuid)
self.assertEqual(self.rc.id, rc[0].id)
def test_get_rcs_by_bay_uuid_that_does_not_exist(self):
self.assertRaises(exception.BayNotFound,
self.dbapi.get_rcs_by_bay_uuid,
self.context,
magnum_utils.generate_uuid())
def test_destroy_rc(self):
self.dbapi.destroy_rc(self.rc.id)
self.assertRaises(exception.ReplicationControllerNotFound,