Merge "NSX|V: ensure backwards compatibility for vdr_transit_network"

This commit is contained in:
Jenkins 2017-01-18 17:38:29 +00:00 committed by Gerrit Code Review
commit 98ff3069b7
4 changed files with 12 additions and 4 deletions

View File

@ -25,6 +25,8 @@ from vmware_nsx.dvs import dvs_utils
from vmware_nsx.extensions import routersize
LOG = logging.getLogger(__name__)
DEFAULT_VDR_TRANSIT_NETWORK = "169.254.2.0/28"
DEFAULT_PLR_ADDRESS = "169.254.2.3"
class AgentModes(object):
@ -636,7 +638,7 @@ nsxv_opts = [
help=_("(Optional) If use_nsx_policies is True, this value "
"will determine if a tenants can add rules to their "
"security groups.")),
cfg.StrOpt('vdr_transit_network', default="169.254.2.0/28",
cfg.StrOpt('vdr_transit_network', default=DEFAULT_VDR_TRANSIT_NETWORK,
help=_("(Optional) Sets the network address for distributed "
"router TLR-PLR connectivity, with "
"<network IP>/<prefix> syntax")),

View File

@ -17,7 +17,6 @@ from oslo_config import cfg
from vmware_nsx.common import nsxv_constants
EDGE_ID = 'edge_id'
ROUTER_ID = 'router_id'
DHCP_EDGE_PREFIX = 'dhcp-'

View File

@ -38,6 +38,7 @@ from neutron_lib.api import validators
from neutron_lib import exceptions as n_exc
from vmware_nsx._i18n import _, _LE, _LW
from vmware_nsx.common import config as conf
from vmware_nsx.common import exceptions as nsx_exc
from vmware_nsx.common import locking
from vmware_nsx.common import nsxv_constants
@ -80,7 +81,12 @@ def get_vdr_transit_network_tlr_address():
def get_vdr_transit_network_plr_address():
ip = _get_vdr_transit_network_ipobj()
return str(ip[2])
# We need to ensure backwards compatibility. The original edge address
# was "169.254.2.3"
if conf.DEFAULT_VDR_TRANSIT_NETWORK == cfg.CONF.nsxv.vdr_transit_network:
return conf.DEFAULT_PLR_ADDRESS
else:
return str(ip[2])
def validate_vdr_transit_network():

View File

@ -22,6 +22,7 @@ from neutron import context
from neutron.plugins.common import constants as plugin_const
from neutron.tests.unit import testlib_api
from neutron_lib import exceptions as n_exc
from vmware_nsx.common import config as conf
from vmware_nsx.common import exceptions as nsx_exc
from vmware_nsx.common import nsxv_constants
from vmware_nsx.db import nsxv_db
@ -778,7 +779,7 @@ class EdgeManagerTestCase(EdgeUtilsTestCaseMixin):
class VdrTransitNetUtilDefaultTestCase(EdgeUtilsTestCaseMixin):
EXPECTED_NETMASK = '255.255.255.240'
EXPECTED_TLR_IP = '169.254.2.1'
EXPECTED_PLR_IP = '169.254.2.2'
EXPECTED_PLR_IP = conf.DEFAULT_PLR_ADDRESS
def setUp(self):
super(VdrTransitNetUtilDefaultTestCase, self).setUp()