31 Commits

Author SHA1 Message Date
Ian Wells
ba0ce71d1c COMPAT CLEANUP: stop importing things from compat
Compat is for compatibility; there are certain things that no longer
need help because they're consistent across all OpenStack versions we
support (really Queens+ at this point).  Remove the compat.py code
that supports this and stop using compat in import lines.

Also removed some conditional importing that was happening outside of
the compatibility layer - which shouldn't happen, but did in odd
places.

Change-Id: I913b184713a85b05ff97dcc14c9459025cb0c0e5
2020-07-28 17:26:12 -07:00
Ian Wells
68d33b43fa COMPAT CLEANUP: remove conditional imports
Remove all the conditionals to create the right imports in compat.py
where they relate to unsupported versions.

This is, in fact, most of them; the actual import lines will be
fixed in a subsequent patch.

Changed use of n_const and plugin_constants in the main body of the
code because they were being mixed up, making for harder work.  The
reason was that at some point the plugin types were moved to a
different file, confusing matters; L3 is a plugin constant, Neutron-
inbuilt network types are not.

We should also look for use of TYPE_VXLAN as it's quite likely that
we shouldn't be using it to refer to GPE networks at all.

Change-Id: I96356a3500b3bbc90f6acb2673fe75df5d027468
2020-07-28 17:19:40 -07:00
Ian Wells
b2a560f83b COMPAT CLEANUP: remove bridge function shim
We were patching bridge support methods into Liberty-and-earlier
Neutrons.  We don't need to support that any longer.

Test included ensures functions we need are present in Neutron.

Change-Id: I6190b7459d8d548a1b2fda7071b1ae285cc5931c
2020-07-28 17:17:06 -07:00
Ian Wells
854a02bb18 COMPAT CLEANUP: remove code for option functions
Option functions are now in a predictable place; use their imports
and lose the code that dealt with older locations in older Neutron
versions.

Change-Id: I6031e71c68679c2ac2a6efb4b696b834ad448523
2020-07-28 02:12:24 +00:00
Ian Wells
ef2b77f99b Bring hacking up to spec
Our version of hacking was ancient, and it loads a pep8 check that
is both very inconsistent in reporting errors and has weaker
constraints.  Fix the pep8 errors revealed and disable some of the
irrelevant tests in tox.ini.

Change-Id: I4ca71aa88456e4ac2baf0cfb3ac058b0a19e3b6b
2020-07-24 10:44:11 -07:00
Naveen Joy
c436f152bb train release compatibility
The CommonDbMixin class used by services is deprecated in
the Train release. This patch ensures Train release
compatibility by using model_query from neuton_lib.db
to query a resource by its ID. Since model_query is
available in the previous releases, this is compatible
with older releases as well. Furthermore, Trunk constants
have changed in Train. This change ensures compatibility
by using the compat module.

Closes-bug: #1884812
Change-Id: Ica4343cb0ea85217d8a3d79e13f95ca6fb6d9927
2020-07-17 20:50:44 +00:00
Onong Tayeng
bda9f2cfe7 compatibility changes for Stein
- neutron.db._resource_extend is now neutron_lib.db.resource_extend
- neutron.db.api is now neutron_lib.db.api
- neutron.db.api.context_manager.reader is now neutron_lib.db.CONTEXT_READER
- neutron.db.api.context_manager.writer is now neutron_lib.db.CONTEXT_WRITER

Change-Id: I49bed1486b26e921b16bae3be25f110a02d77227
2019-07-15 10:21:39 +05:30
Vu Cong Tuan
791c91adae Compatibility fix
Update compatibility with neutron-lib for Rocky.

Change-Id: Iacba29a21e0bcbb159eae984cf601ac8f6f6cf7e
Co-Authored-By: Ian Wells <iawells@cisco.com>
2018-07-19 17:03:10 -07:00
Hareesh Puthalath
90d17f3601 Compat changes for getting get_random_mac in Newton
Importing neutron_lib.utils works in Newton,but it does not
have the get_random_mac, so reverting to neutron.common.utils

Change-Id: Ic95dd2be71d081cf6821f1b0b2353ccfae7ddced
Closes-Bug: #1769713
2018-05-07 11:06:51 -07:00
Ian Wells
9ca50a8f0b Fix l3_vpp compatibility code for older versions
Change-Id: Idba8fff0d35280733de3250f90f269afd349c3a5
2018-02-12 18:18:48 +00:00
Zuul
610b32130c Merge "Compat changes for L3 plugin" 2018-02-07 20:58:14 +00:00
Ian Wells
885869f163 Fix exceptions module name (n_exc not n_exec)
Change-Id: Ib8858600bf91be2b0be6b6dd8db95f163b43c2aa
2018-02-07 18:52:36 +00:00
Hareesh Puthalath
18c51ec854 Compat changes for L3 plugin
Newton version of neutron_lib does not have L3 defined in constants. Using plugin_constants instead.

Change-Id: I6c665ab55c0a47281919acb52a5f7238a6d6180a
2018-02-06 17:21:15 -08:00
Shriram Chander
6252412cfd Updating callback imports from neutron to neutron_lib
Latest neutron has shuffled the 'callbacks' module to neutron_lib,
updating the imports in mech_vpp.py to reflect this.

Change-Id: I6e02fa2d995a7ee48f1497ad422424624083ba7b
2018-02-06 11:53:47 -08:00
Ian Wells
a5836fd1ce Add compat layer for driver_api file
Moved to neutron-lib in Pike/Queens.

Change-Id: Icbfcc60b9722e74f76bc8e9e4c6bfc373c538f35
2017-11-01 09:57:29 +11:00
Shriram Chander
25ddf1ce29 compat.py: Updating neutron.plugins module name
Fixing typo in neutron.plugins module for constants import.

Change-Id: Id46c44a7cc4031d69b3dbaa22c76aaaf2ff5df6b
2017-10-26 10:48:44 -07:00
Ian Wells
426ee0540f Add compatibility for ml2 config module
This recently (Pike-Queens) moved from neutron.plugins.ml2.config to
neutron.conf.plugins.ml2.config and this patch adds a layer in compat.py
to insulate us from that, and also rejigs ml2_vpp config so that the
options for etcd live nearer the code that uses them and in general all
option registering works in a similar fashion.

Addresses-the config problems that were band-aided over in change
Idbf622591e8d92d8e29e3a92799d0e7ff460354a.

Change-Id: I18767336f05a0fdcebfe16ddd46c2a5325d4e661
2017-10-11 08:26:40 +11:00
Ian Wells
d3b0616b5b Update location of TYPE_XXX constants for compatibility
neutron_lib has taken these from neutron.plugin.common - added
compatibility.

Change-Id: I1168eb791c747806d1ce0fef7258418a0e749052
2017-10-11 07:32:38 +11:00
chenghuiyu
1bac3d3645 Stop using get_random_mac via neutron.common.utils
The usage of get_random_mac in the neutron.common.utils
is deprecated for removal in version Pike, and usage of the
get_random_mac from neutron_lib.utils.net is recommended in
new version Queens

Change-Id: I54b40da91c2d7c3c5632993352d5c1a9c4aa7814
Co-Authored-By: Ian Wells <iawells@cisco.com>
2017-10-10 14:13:05 +00:00
Ian Wells
1d787867eb Fix Mitaka compatibility for enable_security_group
When running Mitaka with certain combinations of plugins, the
enable_security_group option is already added and should not
be added again.  This prevents that.

Change-Id: I30423480751fbf884dd8108b85db7664bee9de45
2017-07-04 09:09:07 +10:00
Ian Wells
29c817eb70 Align with neutron_lib standards
This is imperfect, because our compatibility layer that allows
us to work with older versions doesn't cover all the necessary
Neutron inclusions, but excluding N530 we have a pass.

Changes fit into categories:
- LOG.warn -> LOG.warning
- log messages now have kwargs if more than one argument
  (not essential, but used to be for translation and seems
  to be a good practice anyway)
- exception messages must be translated
- translated messages must have named positional arguments
- oslo_serialization.jsonutils must be used, not json
- [] can't be a default argument
- compat is marked with N530 as, there, neutron imports are
  expected.  In other places the mark has been left off, and
  the tox check has been disabled (for later enablement via an
  RFE)

This should not include changes outside of that set.

Change-Id: I1dc050f83a5199bf40117eac6c9adae221ae6857
2017-04-25 18:37:09 +10:00
Naveen Joy
9c878a4d5d VXLAN-GPE feature support
This patch supports the VXLAN-GPE overlay networking capability using ml2
vxlan type driver. To deploy the GPE overlay, set the following options in
devstack - GPE_SRC_CIDR and GPE_LOCATORS. These devstack variables are
translated into ml2 config options named gpe_src_cidr and gpe_locators.
The gpe_src_cidr is the source IPv4 or IPv6 subnet/mask used for the GPE
underlay (uplink) interface. The gpe_locators is the name the physnet
functioning as the uplink source interface used by vxlan-gpe for overlay
encapsulation. In the current version, only one GPE locator
interface is supported. Also vxlan-gpe requires static ARP entries on
tenant instances for reachability.

Closes-Bug:#1676496

Change-Id: I8ddbf01e1436e2a1a258d602297b0426f194f295
2017-04-19 16:08:43 -07:00
Ian Wells
4fcf7c9833 Update compat to include neutron(_lib).context
Change-Id: Ibd61fd06aaed579e6aa487c093f0c29408799489
Closes-Bug: 1670728
2017-03-07 08:16:09 +11:00
Wei Tie
bbdb467de6 Adding BridgeDevice.disable_ipv6 for Liberty compatibility
BridgeDevice doesn't come with disable_ipv6 function in Liberty,
port this function from newer neutron upstream.

Change-Id: I035954a14e56be8a13ddb56844f35e2e4b740d51
Closes-bug: #1666354
2017-02-20 17:58:25 -08:00
Jenkins
2e203c2eb6 Merge "Fix 17.01 Liberty compatibility issue - missing UUID_PATTERN" 2017-02-17 00:38:16 +00:00
Anne McCormick
dab2c4e452 Fix 17.01 Liberty compatibility issue - missing UUID_PATTERN
Change-Id: Ibb5b225b1a4b3d42e253b3f6817e1ae58a7a7c94
Closes-bug: #1665093
2017-02-16 22:50:29 +00:00
Christophe Fontaine
c4e661c4f5 Use neutron-lib portbindings api-def
This patch refactors networking-vpp to use portbindings
from neutron-lib. For more details see [1].

NeutronLibImpact

[1] https://review.openstack.org/422210/

Change-Id: Id97094de943fc1fea57390e6a4abb98c30a659c7
Signed-off-by: Christophe Fontaine <christophe.fontaine@enea.com>
2017-01-30 14:24:37 +01:00
Kevin Bringard
3a4135f6d9 Fixes Liberty compatibility of the constants import
Change-Id: I20db2c557e62d0d8cdf84b45174e97732b5d35fa
Closes-Bug: 1654672
2017-01-06 16:03:59 -07:00
Ian Wells
1f5208463b Compatibility fixes
Further address issues with the compat lib.

Change-Id: Ic9be56b8e2645cb986f12fc50513eab07054ce27
2016-12-23 00:30:20 -08:00
Ian Wells
d420a8bea7 Fix Mitaka compatibility
One of the imports works for Newton but not Mitaka, leaving Mitaka
to fall back to a bunch of imports that don't work for it.  Break
conditionals up.

Change-Id: If8d2ba23728646786ab29752b4207de9eece4d2d
2016-12-23 04:38:01 +00:00
Ian Wells
f05087e74f Bring backward compatibility work into one place
Move all the backward compatibility conditions into
backward_compatibility.py for sanity. This includes a number
of module name-change management bits, and some monkey patching,
all of which existed in the codebase before; we're just trying
to rationalise the locations and the conditionals.

Change-Id: Ifa7769758c2f66f094da40fef67f5213094c43cd
2016-12-20 23:31:57 -08:00