From 27e12b88ad41ed0f092cbedd58664232eb34fe7c Mon Sep 17 00:00:00 2001 From: MirgDenis Date: Tue, 13 Oct 2020 12:26:24 +0300 Subject: [PATCH] Fix neutron-openvswitch-agent-init script Using local variables outside of function is not allowed in bash. During adding route it tries to delete cached route and fails with "Not found" because it can delete only user created routes, so we need to omit Cached routes in ovs/route/show listing. Change-Id: Ifc8da7fc36206f7ebd2e6198dbf192a5a40261af --- neutron/Chart.yaml | 2 +- .../templates/bin/_neutron-openvswitch-agent-init.sh.tpl | 6 +++--- releasenotes/notes/neutron.yaml | 1 + 3 files changed, 5 insertions(+), 4 deletions(-) diff --git a/neutron/Chart.yaml b/neutron/Chart.yaml index 6416684328..5184a12dc9 100644 --- a/neutron/Chart.yaml +++ b/neutron/Chart.yaml @@ -14,7 +14,7 @@ apiVersion: v1 appVersion: v1.0.0 description: OpenStack-Helm Neutron name: neutron -version: 0.2.5 +version: 0.2.6 home: https://docs.openstack.org/neutron/latest/ icon: https://www.openstack.org/themes/openstack/images/project-mascots/Neutron/OpenStack_Project_Neutron_vertical.png sources: diff --git a/neutron/templates/bin/_neutron-openvswitch-agent-init.sh.tpl b/neutron/templates/bin/_neutron-openvswitch-agent-init.sh.tpl index 0b476724a1..969f9d0fab 100644 --- a/neutron/templates/bin/_neutron-openvswitch-agent-init.sh.tpl +++ b/neutron/templates/bin/_neutron-openvswitch-agent-init.sh.tpl @@ -444,13 +444,13 @@ EOF # loop over all nics echo $DPDK_CONFIG | jq -r -c '.bridges[]' | \ while IFS= read -r br; do - local bridge_name=$(get_dpdk_config_value ${br} '.name') - local tunnel_underlay_vlan=$(get_dpdk_config_value ${br} '.tunnel_underlay_vlan') + bridge_name=$(get_dpdk_config_value ${br} '.name') + tunnel_underlay_vlan=$(get_dpdk_config_value ${br} '.tunnel_underlay_vlan') if [[ "${bridge_name}" == "${tunnel_interface}" ]]; then # Route the tunnel traffic via the physical bridge if [[ -n "${LOCAL_IP}" && -n "${PREFIX}" ]]; then - if [[ -n $(ovs-appctl -t ${OVS_CTL} ovs/route/show | grep "${LOCAL_IP}") ]]; then + if [[ -n $(ovs-appctl -t ${OVS_CTL} ovs/route/show | grep "${LOCAL_IP}" | grep -v '^Cached:') ]]; then ovs-appctl -t ${OVS_CTL} ovs/route/del "${LOCAL_IP}"/"${PREFIX}" fi ovs-appctl -t ${OVS_CTL} ovs/route/add "${LOCAL_IP}"/"${PREFIX}" "${tunnel_interface}" diff --git a/releasenotes/notes/neutron.yaml b/releasenotes/notes/neutron.yaml index 16cf78b842..2065db57f4 100644 --- a/releasenotes/notes/neutron.yaml +++ b/releasenotes/notes/neutron.yaml @@ -19,4 +19,5 @@ neutron: - 0.2.3 Mount rabbitmq TLS secret - 0.2.4 Add Ussuri release support - 0.2.5 Use rootwrap daemon + - 0.2.6 Fix neutron agent-init script ...