diff --git a/neutron/common/constants.py b/neutron/common/constants.py index 05a1eea38cc..960ce0b2135 100644 --- a/neutron/common/constants.py +++ b/neutron/common/constants.py @@ -28,10 +28,6 @@ ROUTER_STATUS_ACTIVE = 'ACTIVE' # for agents to indicate when they are wiring up the ports. The following is # to indicate when the server is busy building sub-components of a router ROUTER_STATUS_ALLOCATING = 'ALLOCATING' -L3_AGENT_MODE_DVR = 'dvr' -L3_AGENT_MODE_DVR_SNAT = 'dvr_snat' -L3_AGENT_MODE_LEGACY = 'legacy' -L3_AGENT_MODE = 'agent_mode' DEVICE_ID_RESERVED_DHCP_PORT = "reserved_dhcp_port" @@ -48,7 +44,6 @@ DEFAULT_MINIMUM_AGENTS_FOR_HA = 2 HA_ROUTER_STATE_ACTIVE = 'active' HA_ROUTER_STATE_STANDBY = 'standby' -AGENT_TYPE_MACVTAP = 'Macvtap agent' PAGINATION_INFINITE = 'infinite' SORT_DIRECTION_ASC = 'asc' @@ -68,11 +63,6 @@ VALID_DSCP_MARKS = [0, 8, 10, 12, 14, 16, 18, 20, 22, 24, 26, 28, 30, 32, 34, IP_PROTOCOL_NUM_TO_NAME_MAP = { str(v): k for k, v in lib_constants.IP_PROTOCOL_MAP.items()} -DHCPV6_STATEFUL = 'dhcpv6-stateful' -DHCPV6_STATELESS = 'dhcpv6-stateless' -IPV6_SLAAC = 'slaac' -IPV6_MODES = [DHCPV6_STATEFUL, DHCPV6_STATELESS, IPV6_SLAAC] - # Special provisional prefix for IPv6 Prefix Delegation PROVISIONAL_IPV6_PD_PREFIX = '::/64' diff --git a/tools/list_moved_globals.py b/tools/list_moved_globals.py new file mode 100755 index 00000000000..4018163ad2f --- /dev/null +++ b/tools/list_moved_globals.py @@ -0,0 +1,49 @@ +#!/usr/bin/env python +# +# Licensed under the Apache License, Version 2.0 (the "License"); you may +# not use this file except in compliance with the License. You may obtain +# a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT +# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the +# License for the specific language governing permissions and limitations +# under the License. + +""" +Check for globals that are now available in neutron-lib +""" + +from __future__ import print_function + +from neutron_lib import constants as lconst +from neutron_lib import exceptions as lexc + +from neutron.common import constants as nconst +from neutron.common import exceptions as nexc + + +def check_globals(things, nmod, lmod): + core = vars(nmod)['my_globals'] + lib = vars(lmod) + moved_things = [] + for thing in core: + if thing.startswith('__') or thing == '_': + continue + if thing in lib: + moved_things.append(thing) + if moved_things: + print("\nThese %s have moved to neutron-lib:" % things) + for moved_thing in sorted(moved_things): + print(" %s" % moved_thing) + + +def main(): + check_globals('constants', nconst, lconst) + check_globals('exceptions', nexc, lexc) + + +if __name__ == '__main__': + main() diff --git a/tox.ini b/tox.ini index 5eb26d3f018..6c77d61d65e 100644 --- a/tox.ini +++ b/tox.ini @@ -111,6 +111,7 @@ commands= flake8 sh ./tools/coding-checks.sh --pylint '{posargs}' neutron-db-manage --config-file neutron/tests/etc/neutron.conf check_migration + python ./tools/list_moved_globals.py {[testenv:genconfig]commands} whitelist_externals = sh