Add -n to iptables calls

This change updates the calls that we use in the ocf scripts to
determine if the rules are present to include the -n flag to prevent
unnecessary dns lookups which can lead to deployment failures if dns is
unavailable.

Change-Id: I17d04fbad6def1217429fc3c92bed997fd510eb8
Closes-Bug: #1605540
(cherry picked from 28e3108dcf)
This commit is contained in:
Alex Schultz 2016-07-27 16:41:19 -06:00
parent 5449a63af1
commit 02d7b33ab8
2 changed files with 2 additions and 2 deletions

View File

@ -370,7 +370,7 @@ set_ns_routing() {
fi
# set masquerade on host node
iptables -t nat -L | grep -q masquerade-for-haproxy-namespace
iptables -n -t nat -L | grep -q masquerade-for-haproxy-namespace
if [ $? -gt 0 ]; then
ocf_log debug "Creating NAT rule on the host system for traffic from IP: ${OCF_RESKEY_namespace_ip}"
ocf_run iptables -t nat -A POSTROUTING -s "${OCF_RESKEY_namespace_ip}" -j MASQUERADE -m comment --comment "masquerade-for-haproxy-namespace"

View File

@ -256,7 +256,7 @@ set_ns_routing() {
fi
# set masquerade on host node
iptables -t nat -L | grep -q masquerade-for-vrouter-namespace
iptables -n -t nat -L | grep -q masquerade-for-vrouter-namespace
if [ $? -gt 0 ]; then
ocf_log debug "Creating NAT rule on the host system for traffic from IP: ${OCF_RESKEY_namespace_ip}"
ocf_run iptables -t nat -A POSTROUTING -s "${OCF_RESKEY_namespace_ip}" -j MASQUERADE -m comment --comment "masquerade-for-vrouter-namespace"