Move external_host_ip to a common field

As external_host_ip will be used by chassis snat and bgp, it should
be in a common config group. And its name in devstack script should
be more neutral.

Change-Id: I82d508b21f3e04a9a662b1710dceb2e707c7af0d
This commit is contained in:
Hong Hui Xiao 2017-05-01 19:20:14 +08:00 committed by Li Ma
parent 0dd3f1c666
commit abd78cacf6
10 changed files with 16 additions and 16 deletions

View File

@ -20,7 +20,7 @@
export OVERRIDE_ENABLED_SERVICES=key,n-api,n-cpu,n-cond,n-sch,n-crt,n-cauth,n-obj,g-api,g-reg,c-sch,c-api,c-vol,horizon,rabbit,mysql,dstat,df-controller,df-redis,df-redis-server,q-svc,df-l3-agent,df-metadata,q-qos,placement-api,df-bgp
export DEVSTACK_LOCAL_CONFIG+=$'\n'"DF_REDIS_PUBSUB=True"
export DEVSTACK_LOCAL_CONFIG+=$'\n'"DF_RUNNING_IN_GATE=True"
export DEVSTACK_LOCAL_CONFIG+=$'\n'"SNAT_HOST_IP=172.24.4.100"
export DEVSTACK_LOCAL_CONFIG+=$'\n'"EXTERNAL_HOST_IP=172.24.4.100"
if [ -n "${DEVSTACK_GATE_TEMPEST}"] && [ ${DEVSTACK_GATE_TEMPEST} -gt 0 ]; then
# Only include tempest if this is a tempest job

View File

@ -23,7 +23,7 @@ export DEVSTACK_LOCAL_CONFIG+=$'\n'"DF_SELECTIVE_TOPO_DIST=True"
export DEVSTACK_LOCAL_CONFIG+=$'\n'"ENABLE_PORT_STATUS_NOTIFIER=False"
export DEVSTACK_LOCAL_CONFIG+=$'\n'"ENABLE_ACTIVE_DETECTION=False"
export DEVSTACK_LOCAL_CONFIG+=$'\n'"DF_RUNNING_IN_GATE=True"
export DEVSTACK_LOCAL_CONFIG+=$'\n'"SNAT_HOST_IP=172.24.4.100"
export DEVSTACK_LOCAL_CONFIG+=$'\n'"EXTERNAL_HOST_IP=172.24.4.100"
if [ -n "${DEVSTACK_GATE_TEMPEST}"] && [ ${DEVSTACK_GATE_TEMPEST} -gt 0 ]; then
# Only include tempest if this is a tempest job

View File

@ -13,8 +13,8 @@ OVS_REPO_NAME=$(basename ${OVS_REPO} | cut -f1 -d'.')
# The branch to use from $OVS_REPO
OVS_BRANCH=${OVS_BRANCH:-branch-2.6}
#Set empty SNAT_HOST_IP
SNAT_HOST_IP=${SNAT_HOST_IP:-}
# Set empty EXTERNAL_HOST_IP
EXTERNAL_HOST_IP=${EXTERNAL_HOST_IP:-}
DEFAULT_TUNNEL_TYPE="geneve"
DEFAULT_APPS_LIST="l2_app.L2App,l3_proactive_app.L3ProactiveApp,"\
@ -31,7 +31,7 @@ if [[ "$ENABLE_ACTIVE_DETECTION" == "True" ]]; then
DEFAULT_APPS_LIST="$DEFAULT_APPS_LIST,active_port_detection_app.ActivePortDetectionApp"
fi
if [[ ! -z ${SNAT_HOST_IP} ]]; then
if [[ ! -z ${EXTERNAL_HOST_IP} ]]; then
DEFAULT_APPS_LIST="$DEFAULT_APPS_LIST,chassis_snat_app.ChassisSNATApp"
fi
@ -247,8 +247,8 @@ function configure_df_plugin {
iniset $DRAGONFLOW_CONF df_dnat_app external_network_bridge "$PUBLIC_BRIDGE"
iniset $DRAGONFLOW_CONF df_dnat_app int_peer_patch_port "$INTEGRATION_PEER_PORT"
iniset $DRAGONFLOW_CONF df_dnat_app ex_peer_patch_port "$PUBLIC_PEER_PORT"
if [[ ! -z ${SNAT_HOST_IP} ]]; then
iniset $DRAGONFLOW_CONF df_snat_app external_host_ip "$SNAT_HOST_IP"
if [[ ! -z ${EXTERNAL_HOST_IP} ]]; then
iniset $DRAGONFLOW_CONF df external_host_ip "$EXTERNAL_HOST_IP"
fi
if [[ "$DF_PUB_SUB" == "True" ]]; then

View File

@ -170,7 +170,9 @@ df_opts = [
cfg.IntOpt('neutron_listener_report_delay',
default=10,
help=_('The max delay in seconds for Neutron to report heart'
'beat to df-db'))
'beat to df-db')),
cfg.StrOpt('external_host_ip',
help=_("Compute node external IP"))
]

View File

@ -18,8 +18,6 @@ from oslo_config import cfg
from dragonflow._i18n import _
df_snat_app_opts = [
cfg.StrOpt('external_host_ip',
help=_("Compute node external IP")),
cfg.BoolOpt('enable_goto_flows',
default=True,
help=_("Enable install of common goto flows to ingress/egress "

View File

@ -43,7 +43,7 @@ class ChassisSNATApp(df_base_app.DFlowApp, snat_mixin.SNATApp_mixin):
self.chassis = None
# new application configuration
self.external_host_ip = cfg.CONF.df_snat_app.external_host_ip
self.external_host_ip = cfg.CONF.df.external_host_ip
self.enable_goto_flows = cfg.CONF.df_snat_app.enable_goto_flows
# create mac address based on given 'external_host_ip'

View File

@ -400,8 +400,8 @@ class DfLocalController(object):
ip=self.ip,
tunnel_types=self.tunnel_types,
)
if cfg.CONF.df_snat_app.external_host_ip:
chassis.external_host_ip = cfg.CONF.df_snat_app.external_host_ip
if cfg.CONF.df.external_host_ip:
chassis.external_host_ip = cfg.CONF.df.external_host_ip
self.db_store2.update(chassis)

View File

@ -56,7 +56,7 @@ class TestSnatFlows(test_base.DFTestBase):
'name': 'private',
'enable_dhcp': True}
external_host_ip = cfg.CONF.df_snat_app.external_host_ip
external_host_ip = cfg.CONF.df.external_host_ip
self.assertIsNotNone(external_host_ip)
split_ip = external_host_ip.split('.')
ip2mac = '{:02x}:{:02x}:{:02x}:{:02x}'.format(*map(int, split_ip))

View File

@ -27,7 +27,7 @@ class TestChassisSNATApp(test_app_base.DFAppTestBase):
def setUp(self):
cfg.CONF.set_override('external_host_ip',
self.external_host_ip,
group='df_snat_app')
group='df')
super(TestChassisSNATApp, self).setUp()
self.SNAT_app = self.open_flow_app.dispatcher.apps[0]
self.SNAT_app.external_ofport = 99

View File

@ -207,7 +207,7 @@ class DfLocalControllerTestCase(test_app_base.DFAppTestBase):
def test_register_chassis(self):
cfg.CONF.set_override('external_host_ip',
'172.24.4.100',
group='df_snat_app')
group='df')
self.controller.register_chassis()
expected_chassis = core.Chassis(
id=self.controller.chassis_name,