Remove iptables rules only in virtual deployment 79/35579/1
authorAlex Yang <yangyang1@zte.com.cn>
Wed, 31 May 2017 14:58:44 +0000 (22:58 +0800)
committerAlex Yang <yangyang1@zte.com.cn>
Wed, 31 May 2017 14:58:44 +0000 (22:58 +0800)
There are error messages "iptables: No chain/target/match by that name"
in baremetal deployment:
https://build.opnfv.org/ci/job/daisy-deploy-daily-master/298/console

Change-Id: I7e2940222fd0a99ee42823a08a285bdd93892fe6
Signed-off-by: Alex Yang <yangyang1@zte.com.cn>
ci/deploy/deploy.sh

index e79433a..acf99dd 100755 (executable)
@@ -369,11 +369,13 @@ fi
 echo "====== post deploy ======"
 ssh $SSH_PARAS $DAISY_IP "bash $REMOTE_SPACE/deploy/post.sh -n $NETWORK"
 
-echo "====== disable iptable rules ======"
-sudo iptables -D FORWARD -o daisy1 -j REJECT --reject-with icmp-port-unreachable
-sudo iptables -D FORWARD -i daisy1 -j REJECT --reject-with icmp-port-unreachable
-sudo iptables -D FORWARD -o daisy2 -j REJECT --reject-with icmp-port-unreachable
-sudo iptables -D FORWARD -i daisy2 -j REJECT --reject-with icmp-port-unreachable
+if [ $IS_BARE == 0 ]; then
+    echo "====== disable iptable rules ======"
+    iptables -D FORWARD -o daisy1 -j REJECT --reject-with icmp-port-unreachable
+    iptables -D FORWARD -i daisy1 -j REJECT --reject-with icmp-port-unreachable
+    iptables -D FORWARD -o daisy2 -j REJECT --reject-with icmp-port-unreachable
+    iptables -D FORWARD -i daisy2 -j REJECT --reject-with icmp-port-unreachable
+fi
 
 echo "====== deploy successfully ======"