Remove neutron-lib warnings

Addresses warnings for constants now supported in neutron lib.

TrivialFix

Change-Id: Ia450b8e6a71714a913219e806770652281f9f31d
This commit is contained in:
Gary Kotton 2016-08-04 01:55:06 -07:00 committed by garyk
parent a96b84e1c1
commit 101af7b661
2 changed files with 10 additions and 11 deletions

View File

@ -319,8 +319,8 @@ class L3_HA_NAT_db_mixin(l3_dvr_db.L3_NAT_with_dvr_db_mixin,
min_agents = cfg.CONF.min_l3_agents_per_router
num_agents = len(self.get_l3_agents(context, active=True,
filters={'agent_modes': [n_const.L3_AGENT_MODE_LEGACY,
n_const.L3_AGENT_MODE_DVR_SNAT]}))
filters={'agent_modes': [constants.L3_AGENT_MODE_LEGACY,
constants.L3_AGENT_MODE_DVR_SNAT]}))
max_agents = cfg.CONF.max_l3_agents_per_router
if max_agents:
if max_agents > num_agents:
@ -723,8 +723,8 @@ class L3_HA_NAT_db_mixin(l3_dvr_db.L3_NAT_with_dvr_db_mixin,
def get_ha_sync_data_for_host(self, context, host, agent,
router_ids=None, active=None):
agent_mode = self._get_agent_mode(agent)
dvr_agent_mode = (agent_mode in [n_const.L3_AGENT_MODE_DVR_SNAT,
n_const.L3_AGENT_MODE_DVR])
dvr_agent_mode = (agent_mode in [constants.L3_AGENT_MODE_DVR_SNAT,
constants.L3_AGENT_MODE_DVR])
if (dvr_agent_mode and n_utils.is_extension_supported(
self, constants.L3_DISTRIBUTED_EXT_ALIAS)):
# DVR has to be handled differently

View File

@ -26,7 +26,6 @@ from oslo_utils import timeutils
from sqlalchemy import orm
import testscenarios
from neutron.common import constants as n_const
from neutron import context as n_context
from neutron.db import agents_db
from neutron.db import db_base_plugin_v2 as db_v2
@ -286,18 +285,18 @@ class L3SchedulerBaseMixin(object):
def _register_l3_agents(self, plugin=None):
self.agent1 = helpers.register_l3_agent(
'host_1', n_const.L3_AGENT_MODE_LEGACY)
'host_1', constants.L3_AGENT_MODE_LEGACY)
self.agent_id1 = self.agent1.id
self.agent2 = helpers.register_l3_agent(
'host_2', n_const.L3_AGENT_MODE_LEGACY)
'host_2', constants.L3_AGENT_MODE_LEGACY)
self.agent_id2 = self.agent2.id
def _register_l3_dvr_agents(self):
self.l3_dvr_agent = helpers.register_l3_agent(
HOST_DVR, n_const.L3_AGENT_MODE_DVR)
HOST_DVR, constants.L3_AGENT_MODE_DVR)
self.l3_dvr_agent_id = self.l3_dvr_agent.id
self.l3_dvr_snat_agent = helpers.register_l3_agent(
HOST_DVR_SNAT, n_const.L3_AGENT_MODE_DVR_SNAT)
HOST_DVR_SNAT, constants.L3_AGENT_MODE_DVR_SNAT)
self.l3_dvr_snat_id = self.l3_dvr_snat_agent.id
def _set_l3_agent_admin_state(self, context, agent_id, state=True):
@ -1676,7 +1675,7 @@ class L3HAChanceSchedulerTestCase(L3HATestCaseMixin):
def test_auto_schedule_ha_router_when_incompatible_agent_exist(self):
handle_internal_only_routers_agent = helpers.register_l3_agent(
'host_3', n_const.L3_AGENT_MODE_LEGACY, internal_only=False)
'host_3', constants.L3_AGENT_MODE_LEGACY, internal_only=False)
router = self._create_ha_router()
self.plugin.auto_schedule_routers(
@ -1690,7 +1689,7 @@ class L3HAChanceSchedulerTestCase(L3HATestCaseMixin):
def test_auto_schedule_ha_router_when_dvr_agent_exist(self):
dvr_agent = helpers.register_l3_agent(
HOST_DVR, n_const.L3_AGENT_MODE_DVR)
HOST_DVR, constants.L3_AGENT_MODE_DVR)
router = self._create_ha_router()
self.plugin.auto_schedule_routers(self.adminContext, dvr_agent.host,