Merge "NSXv BGP: Allow BGP only on networks with address-scope"

This commit is contained in:
Jenkins 2017-05-14 15:14:03 +00:00 committed by Gerrit Code Review
commit 2cdab3af8c
2 changed files with 8 additions and 2 deletions

View File

@ -179,8 +179,9 @@ class NsxInvalidConfiguration(n_exc.InvalidConfigurationOption):
class NsxBgpSpeakerUnableToAddGatewayNetwork(n_exc.BadRequest):
message = _("Unable to add gateway network %(network_id)s to BGP speaker "
"%(bgp_speaker_id)s, network may be associated with one BGP "
"speaker at most.")
"%(bgp_speaker_id)s, network must have association with an "
"address-scope and can be associated with one BGP speaker at "
"most.")
class NsxRouterInterfaceDoesNotMatchAddressScope(n_exc.BadRequest):

View File

@ -19,6 +19,7 @@ from oslo_config import cfg
from oslo_log import log as logging
from oslo_utils import excutils
from neutron.extensions import address_scope
from neutron_lib import constants as n_const
from neutron_lib import exceptions as n_exc
from neutron_lib.plugins import directory
@ -377,6 +378,10 @@ class NSXvBgpDriver(object):
raise ext_esg_peer.ExternalSubnetHasGW(
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(
context, gateway_network_id, bgp_speaker_id)