Deprecate and remove "get_agents_db"
This method is superseded by "get_agent_objects". Projects using this method: - networking-odl:https://review.opendev.org/c/openstack/networking-odl/+/792014 Trivial-Fix Change-Id: I247bf2885a8b1bf9205f25d45ee3b905b56b0c05
This commit is contained in:
parent
9e6b7a2284
commit
951a3f0eb3
|
@ -28,7 +28,6 @@ from neutron_lib.callbacks import resources
|
|||
from neutron_lib import constants
|
||||
from neutron_lib import context
|
||||
from neutron_lib.db import api as db_api
|
||||
from neutron_lib.db import model_query
|
||||
from neutron_lib.db import utils as db_utils
|
||||
from neutron_lib.exceptions import agent as agent_exc
|
||||
from neutron_lib.exceptions import availability_zone as az_exc
|
||||
|
@ -43,7 +42,6 @@ from oslo_utils import timeutils
|
|||
from neutron.agent.common import utils
|
||||
from neutron.api.rpc.callbacks import version_manager
|
||||
from neutron.conf.agent.database import agents_db
|
||||
from neutron.db.models import agent as agent_model
|
||||
from neutron.extensions import agent as ext_agent
|
||||
from neutron.extensions import availability_zone as az_ext
|
||||
from neutron.objects import agent as agent_obj
|
||||
|
@ -279,15 +277,6 @@ class AgentDbMixin(ext_agent.AgentPluginBase, AgentAvailabilityZoneMixin):
|
|||
agent.update()
|
||||
return self._make_agent_dict(agent)
|
||||
|
||||
@db_api.retry_if_session_inactive()
|
||||
def get_agents_db(self, context, filters=None):
|
||||
# TODO(annp): keep this method for backward compatibility,
|
||||
# will need to clean it up later
|
||||
query = model_query.get_collection_query(context,
|
||||
agent_model.Agent,
|
||||
filters=filters)
|
||||
return query.all()
|
||||
|
||||
@db_api.retry_if_session_inactive()
|
||||
def get_agent_objects(self, context, filters=None):
|
||||
filters = filters or {}
|
||||
|
|
|
@ -1823,7 +1823,7 @@ class L3AgentSchedulerDbMixinTestCase(L3HATestCaseMixin):
|
|||
self.assertNotIn(agent.id, results)
|
||||
|
||||
def test_add_ha_interface_to_l3_agent(self):
|
||||
agent = self.plugin.get_agents_db(self.adminContext)[0]
|
||||
agent = self.plugin.get_agent_objects(self.adminContext)[0]
|
||||
router = self._create_ha_router()
|
||||
self.plugin.add_router_to_l3_agent(self.adminContext, agent.id,
|
||||
router['id'])
|
||||
|
|
Loading…
Reference in New Issue