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
This commit is contained in:
Alex Schultz 2016-07-27 16:41:19 -06:00
parent ba0e2b8d50
commit 28e3108dcf
2 changed files with 2 additions and 2 deletions

View File

@ -372,7 +372,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

@ -257,7 +257,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"