Merge "NSXv BGP: Allow BGP only on networks with address-scope"
This commit is contained in:
commit
2cdab3af8c
@ -179,8 +179,9 @@ class NsxInvalidConfiguration(n_exc.InvalidConfigurationOption):
|
|||||||
|
|
||||||
class NsxBgpSpeakerUnableToAddGatewayNetwork(n_exc.BadRequest):
|
class NsxBgpSpeakerUnableToAddGatewayNetwork(n_exc.BadRequest):
|
||||||
message = _("Unable to add gateway network %(network_id)s to BGP speaker "
|
message = _("Unable to add gateway network %(network_id)s to BGP speaker "
|
||||||
"%(bgp_speaker_id)s, network may be associated with one BGP "
|
"%(bgp_speaker_id)s, network must have association with an "
|
||||||
"speaker at most.")
|
"address-scope and can be associated with one BGP speaker at "
|
||||||
|
"most.")
|
||||||
|
|
||||||
|
|
||||||
class NsxRouterInterfaceDoesNotMatchAddressScope(n_exc.BadRequest):
|
class NsxRouterInterfaceDoesNotMatchAddressScope(n_exc.BadRequest):
|
||||||
|
@ -19,6 +19,7 @@ from oslo_config import cfg
|
|||||||
from oslo_log import log as logging
|
from oslo_log import log as logging
|
||||||
from oslo_utils import excutils
|
from oslo_utils import excutils
|
||||||
|
|
||||||
|
from neutron.extensions import address_scope
|
||||||
from neutron_lib import constants as n_const
|
from neutron_lib import constants as n_const
|
||||||
from neutron_lib import exceptions as n_exc
|
from neutron_lib import exceptions as n_exc
|
||||||
from neutron_lib.plugins import directory
|
from neutron_lib.plugins import directory
|
||||||
@ -377,6 +378,10 @@ class NSXvBgpDriver(object):
|
|||||||
raise ext_esg_peer.ExternalSubnetHasGW(
|
raise ext_esg_peer.ExternalSubnetHasGW(
|
||||||
network_id=gateway_network_id, subnet_id=subnet_id)
|
network_id=gateway_network_id, subnet_id=subnet_id)
|
||||||
|
|
||||||
|
if not ext_net[address_scope.IPV4_ADDRESS_SCOPE]:
|
||||||
|
raise nsx_exc.NsxBgpSpeakerUnableToAddGatewayNetwork(
|
||||||
|
network_id=gateway_network_id, bgp_speaker_id=bgp_speaker_id)
|
||||||
|
|
||||||
edge_router_dict = self._get_dynamic_routing_edge_list(
|
edge_router_dict = self._get_dynamic_routing_edge_list(
|
||||||
context, gateway_network_id, bgp_speaker_id)
|
context, gateway_network_id, bgp_speaker_id)
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user