remove SHARED constant that now lives in neutron-lib

The SHARED constant was rehomed into neutron-lib with commit
If123044496b54a8bfc115ab41b8506ec5d7ba5a3
This patch removes the SHARED constant from vmware-nsx and switches all
uses to neutron-lib's version.

Change-Id: I8ab75021399b5a85f5bfe8de858d8c4309b741dc
This commit is contained in:
Boden R 2018-03-01 15:51:12 -07:00
parent 2825e30777
commit 5106963756
5 changed files with 7 additions and 7 deletions

View File

@ -20,7 +20,6 @@ XLARGE = 'xlarge'
QUADLARGE = 'quadlarge'
SHARED = "shared"
EXCLUSIVE = "exclusive"
# Edge type

View File

@ -14,7 +14,8 @@
# under the License.
#
from vmware_nsx.common import nsxv_constants
from neutron_lib import constants
from vmware_nsx.db import (
distributedrouter as dist_rtr)
from vmware_nsx.extensions import routertype as rt_rtr
@ -26,5 +27,5 @@ class RouterType_mixin(dist_rtr.DistributedRouter_mixin):
nsx_attributes = (
dist_rtr.DistributedRouter_mixin.nsx_attributes + [{
'name': rt_rtr.ROUTER_TYPE,
'default': nsxv_constants.SHARED
'default': constants.SHARED
}])

View File

@ -37,7 +37,6 @@ from sqlalchemy.orm import exc as sa_exc
import webob.exc
from neutron.api import extensions as neutron_extensions
from neutron.api.v2 import attributes as attr
from neutron.db import _model_query as model_query
from neutron.db import _resource_extend as resource_extend
from neutron.db import _utils as db_utils
@ -963,7 +962,7 @@ class NsxPluginV2(addr_pair_db.AllowedAddressPairsMixin,
self.cluster, net_data['id'],
tenant_id, net_data.get('name'),
transport_zone_config,
shared=net_data.get(attr.SHARED))
shared=net_data.get(constants.SHARED))
with db_api.context_manager.writer.using(context):
new_net = super(NsxPluginV2, self).create_network(context,

View File

@ -3067,7 +3067,7 @@ class NsxVPluginV2(addr_pair_db.AllowedAddressPairsMixin,
# exception.
r = router['router']
if validators.is_attr_set(r.get(ROUTER_SIZE)):
if r.get('router_type') == nsxv_constants.SHARED:
if r.get('router_type') == constants.SHARED:
msg = _("Cannot specify router-size for shared router")
raise n_exc.BadRequest(resource="router", msg=msg)
elif r.get('distributed') is True:

View File

@ -13,6 +13,7 @@
# License for the specific language governing permissions and limitations
# under the License.
from neutron_lib import constants
from neutron_vpnaas.db.vpn import vpn_validator
from oslo_log import log as logging
@ -80,7 +81,7 @@ class IPsecValidator(vpn_validator.VpnReferenceValidator):
break
def _is_shared_router(self, router):
return router.get('router_type') == nsxv_constants.SHARED
return router.get('router_type') == constants.SHARED
def _validate_router(self, context, router_id):
# Only support distributed and exclusive router type