Remove unused DB API and Service object API

Bug #1490381 reported by Vilobh Meshram
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Magnum
Fix Released
Undecided
Vilobh Meshram

Bug Description

get_rcs_by_bay_uuid / get_pods_by_bay_uuid / get_services_by_bay_uuid

have dead code and is not used by any consumer - magnum client or anyone else. We should clean it up.

Revision history for this message
Vilobh Meshram (vilobhmm) wrote :

[ ] $ grep -nR "get_services_by_bay_uuid" .

./magnum/db/api.py:544: def get_services_by_bay_uuid(self, bay_uuid):
./magnum/db/sqlalchemy/api.py:784: def get_services_by_bay_uuid(self, bay_uuid):
./magnum/objects/service.py:110: db_services = cls.dbapi.get_services_by_bay_uuid(bay_uuid)
./magnum/tests/unit/db/test_service.py:150: def test_get_services_by_bay_uuid(self):
./magnum/tests/unit/db/test_service.py:151: res = self.dbapi.get_services_by_bay_uuid(self.bay.uuid)
./magnum/tests/unit/db/test_service.py:154: def test_get_services_by_bay_uuid_that_does_not_exist(self):
./magnum/tests/unit/db/test_service.py:155: res = self.dbapi.get_services_by_bay_uuid(magnum_utils.generate_uuid())

[] $ grep -nR "get_pods_by_bay_uuid" .
./magnum/db/api.py:463: def get_pods_by_bay_uuid(self, bay_uuid):
./magnum/db/sqlalchemy/api.py:690: def get_pods_by_bay_uuid(self, context, bay_uuid):
./magnum/objects/pod.py:108: db_pods = cls.dbapi.get_pods_by_bay_uuid(context, bay_uuid)
./magnum/tests/unit/db/test_pod.py:151: def test_get_pods_by_bay_uuid(self):
./magnum/tests/unit/db/test_pod.py:152: res = self.dbapi.get_pods_by_bay_uuid(self.context,
./magnum/tests/unit/db/test_pod.py:156: def test_get_pods_by_bay_uuid_that_does_not_exist(self):
./magnum/tests/unit/db/test_pod.py:158: self.dbapi.get_pods_by_bay_uuid,
./magnum/tests/unit/objects/test_pod.py:60: with mock.patch.object(self.dbapi, 'get_pods_by_bay_uuid',

[] $ grep -nR "get_rcs_by_bay_uuid" .
./magnum/db/api.py:597: def get_rcs_by_bay_uuid(self, bay_uuid):
./magnum/db/sqlalchemy/api.py:889: def get_rcs_by_bay_uuid(self, bay_uuid):
./magnum/tests/unit/db/test_replicationcontroller.py:108: def test_get_rcs_by_bay_uuid(self):
./magnum/tests/unit/db/test_replicationcontroller.py:109: rc = self.dbapi.get_rcs_by_bay_uuid(self.bay.uuid)
./magnum/tests/unit/db/test_replicationcontroller.py:112: def test_get_rcs_by_bay_uuid_that_does_not_exist(self):
./magnum/tests/unit/db/test_replicationcontroller.py:113: res = self.dbapi.get_rcs_by_bay_uuid(magnum_utils.generate_uuid())
[ ] $

Changed in magnum:
assignee: nobody → Vilobh Meshram (vilobhmm)
Revision history for this message
Vilobh Meshram (vilobhmm) wrote :

Since other resources are covered as part of

POD : https://review.openstack.org/#/c/217908/

RC : https://review.openstack.org/#/c/217865/

Changing the subject to be more specific to 'service' resource.

summary: - Remove few dead API
+ Remove unused DB API and Service object API
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix proposed to magnum (master)

Fix proposed to branch: master
Review: https://review.openstack.org/219043

Changed in magnum:
status: New → In Progress
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Change abandoned on magnum (master)

Change abandoned by Adrian Otto (<email address hidden>) on branch: master
Review: https://review.openstack.org/219043
Reason: Work on this patch may resume in accordance with the above guidance.

Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to magnum (master)

Reviewed: https://review.openstack.org/219043
Committed: https://git.openstack.org/cgit/openstack/magnum/commit/?id=bb9379de5cdf96cc3379162ab4585f4f8816e588
Submitter: Jenkins
Branch: master

commit bb9379de5cdf96cc3379162ab4585f4f8816e588
Author: Vilobh Meshram <email address hidden>
Date: Tue Sep 29 16:07:01 2015 -0700

    Remove unused DB API and Service object API

    This patch removes unused DB API 'get_services_by_bay_uuid',
    Service object layer API 'list_by_bay_uuid' and the
    associated unit tests. There are no consumers of this
    code as this code is not invoked by anyone. Cleaning
    this up will help to remove some dead code.

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

    Closes-Bug: #1490381
    Related-Bug: #1499121

    Change-Id: I09434dee206099ccd4e78eede7c157c64e6343ea

Changed in magnum:
status: In Progress → Fix Committed
Adrian Otto (aotto)
Changed in magnum:
milestone: none → mitaka-1
status: Fix Committed → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.