Merge "Neutron: check that local ip address is populated on agent startup"

This commit is contained in:
Zuul 2018-07-07 06:31:58 +00:00 committed by Gerrit Code Review
commit 87fc03793b
2 changed files with 16 additions and 6 deletions

View File

@ -41,8 +41,13 @@ if [ -z "${tunnel_interface}" ] ; then
fi
# determine local-ip dynamically based on interface provided but only if tunnel_types is not null
IP=$(ip a s $tunnel_interface | grep 'inet ' | awk '{print $2}' | awk -F "/" '{print $1}')
cat <<EOF>/tmp/pod-shared/ml2-local-ip.ini
LOCAL_IP=$(ip a s $tunnel_interface | grep 'inet ' | awk '{print $2}' | awk -F "/" '{print $1}')
if [ -z "${LOCAL_IP}" ] ; then
echo "Var LOCAL_IP is empty"
exit 1
fi
tee > /tmp/pod-shared/ml2-local-ip.ini << EOF
[vxlan]
local_ip = $IP
local_ip = "${LOCAL_IP}"
EOF

View File

@ -52,8 +52,13 @@ if [ -z "${tunnel_interface}" ] ; then
fi
# determine local-ip dynamically based on interface provided but only if tunnel_types is not null
IP=$(ip a s $tunnel_interface | grep 'inet ' | awk '{print $2}' | awk -F "/" '{print $1}')
cat <<EOF>/tmp/pod-shared/ml2-local-ip.ini
LOCAL_IP=$(ip a s $tunnel_interface | grep 'inet ' | awk '{print $2}' | awk -F "/" '{print $1}')
if [ -z "${LOCAL_IP}" ] ; then
echo "Var LOCAL_IP is empty"
exit 1
fi
tee > /tmp/pod-shared/ml2-local-ip.ini << EOF
[ovs]
local_ip = $IP
local_ip = "${LOCAL_IP}"
EOF