Skip to content

Commit

Permalink
Ignore iptables errors
Browse files Browse the repository at this point in the history
We have always been ignoring errors from these commands but
"set -e" recently got added to these scripts so they now
cause the scripts to fail. Ignore the error while we
figure out a way to eleminate it altogether.
  • Loading branch information
derekhiggins committed Jul 30, 2019
1 parent 5c2f1f8 commit 4d409ea
Show file tree
Hide file tree
Showing 5 changed files with 8 additions and 8 deletions.
2 changes: 1 addition & 1 deletion rundnsmasq.sh
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ done
# Allow access to dhcp and tftp server for pxeboot
for port in 67 69 ; do
if ! iptables -C INPUT -i "$PROVISIONING_INTERFACE" -p udp --dport "$port" -j ACCEPT 2>/dev/null ; then
iptables -I INPUT -i "$PROVISIONING_INTERFACE" -p udp --dport "$port" -j ACCEPT
iptables -I INPUT -i "$PROVISIONING_INTERFACE" -p udp --dport "$port" -j ACCEPT || true
fi
done

Expand Down
2 changes: 1 addition & 1 deletion runhttpd.sh
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ ln -s /shared/log/httpd/error_log /var/log/httpd/error_log

# Allow external access
if ! iptables -C INPUT -i "$PROVISIONING_INTERFACE" -p tcp --dport "$HTTP_PORT" -j ACCEPT 2>/dev/null ; then
iptables -I INPUT -i "$PROVISIONING_INTERFACE" -p tcp --dport "$HTTP_PORT" -j ACCEPT
iptables -I INPUT -i "$PROVISIONING_INTERFACE" -p tcp --dport "$HTTP_PORT" -j ACCEPT || true
fi

/usr/sbin/httpd &
Expand Down
2 changes: 1 addition & 1 deletion runironic-api.sh
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ set -e

# Allow access to Ironic
if ! iptables -C INPUT -i "$PROVISIONING_INTERFACE" -p tcp -m tcp --dport 6385 -j ACCEPT > /dev/null 2>&1; then
iptables -I INPUT -i "$PROVISIONING_INTERFACE" -p tcp -m tcp --dport 6385 -j ACCEPT
iptables -I INPUT -i "$PROVISIONING_INTERFACE" -p tcp -m tcp --dport 6385 -j ACCEPT || true
fi

exec /usr/bin/ironic-api --config-file /etc/ironic/ironic.conf \
Expand Down
4 changes: 2 additions & 2 deletions runironic-conductor.sh
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,10 @@ set -e

# Allow access to mDNS
if ! iptables -C INPUT -i $PROVISIONING_INTERFACE -p udp --dport 5353 -j ACCEPT > /dev/null 2>&1; then
iptables -I INPUT -i $PROVISIONING_INTERFACE -p udp --dport 5353 -j ACCEPT
iptables -I INPUT -i $PROVISIONING_INTERFACE -p udp --dport 5353 -j ACCEPT || true
fi
if ! iptables -C OUTPUT -p udp --dport 5353 -j ACCEPT > /dev/null 2>&1; then
iptables -I OUTPUT -p udp --dport 5353 -j ACCEPT
iptables -I OUTPUT -p udp --dport 5353 -j ACCEPT || true
fi

# Ramdisk logs
Expand Down
6 changes: 3 additions & 3 deletions runironic.sh
Original file line number Diff line number Diff line change
Expand Up @@ -4,15 +4,15 @@

# Allow access to Ironic
if ! iptables -C INPUT -i "$PROVISIONING_INTERFACE" -p tcp -m tcp --dport 6385 -j ACCEPT > /dev/null 2>&1; then
iptables -I INPUT -i "$PROVISIONING_INTERFACE" -p tcp -m tcp --dport 6385 -j ACCEPT
iptables -I INPUT -i "$PROVISIONING_INTERFACE" -p tcp -m tcp --dport 6385 -j ACCEPT || true
fi

# Allow access to mDNS
if ! iptables -C INPUT -i $PROVISIONING_INTERFACE -p udp --dport 5353 -j ACCEPT > /dev/null 2>&1; then
iptables -I INPUT -i $PROVISIONING_INTERFACE -p udp --dport 5353 -j ACCEPT
iptables -I INPUT -i $PROVISIONING_INTERFACE -p udp --dport 5353 -j ACCEPT || true
fi
if ! iptables -C OUTPUT -p udp --dport 5353 -j ACCEPT > /dev/null 2>&1; then
iptables -I OUTPUT -p udp --dport 5353 -j ACCEPT
iptables -I OUTPUT -p udp --dport 5353 -j ACCEPT || true
fi

ironic-dbsync --config-file /etc/ironic/ironic.conf upgrade
Expand Down

0 comments on commit 4d409ea

Please sign in to comment.