Fix multirack routes installation for vrouter and haproxy

1. Both scripts do not flush ip route table for non-local
   routes, which makes them non-idempotent
2. Haproxy did not add routes on reload

Change-Id: I498870b45ac47e6d6d8808d18964f3c2777c930c
Closes-bug: #1652765
(cherry picked from commit a4ad419368)
This commit is contained in:
Vladimir Kuklin 2017-01-04 20:47:26 +03:00 committed by Alexey Shtokolov
parent e528f4cca2
commit 864c8e8696
2 changed files with 5 additions and 0 deletions

View File

@ -366,6 +366,8 @@ set_ns_routing() {
ocf_log debug "Setting namespace interface: ${OCF_RESKEY_namespace_interface} IP to: ${OCF_RESKEY_namespace_ip}/${OCF_RESKEY_network_mask}"
ocf_run nsip addr add "${OCF_RESKEY_namespace_ip}/${OCF_RESKEY_network_mask}" dev "${OCF_RESKEY_namespace_interface}"
fi
ocf_log debug "Flushing global scope routes"
nsip route flush scope global
# set default gateway inside ns
nsip route list | grep -q "default via ${OCF_RESKEY_host_ip}"
@ -485,6 +487,7 @@ haproxy_reload()
ocf_log err "Error. haproxy daemon returned error $?."
return $OCF_ERR_GENERIC
fi
set_ns_routing
else
ocf_log info "Haproxy daemon is not running. Starting it."
haproxy_start

View File

@ -248,6 +248,8 @@ set_ns_routing() {
ocf_log debug "Setting namespace interface: ${OCF_RESKEY_namespace_interface} IP to: ${OCF_RESKEY_namespace_ip}/${OCF_RESKEY_network_mask}"
ocf_run nsip addr add "${OCF_RESKEY_namespace_ip}/${OCF_RESKEY_network_mask}" dev "${OCF_RESKEY_namespace_interface}"
fi
ocf_log debug "Flushing global scope routes"
nsip route flush scope global
# set default gateway inside ns
nsip route list | grep -q "default via ${OCF_RESKEY_host_ip}"