+function remove_iptables() {
+ stack=$1
+ if [ -z "$OSM_VCA_HOST" ]; then
+ OSM_VCA_HOST=`sg lxd -c "juju show-controller ${stack}"|grep api-endpoints|awk -F\' '{print $2}'|awk -F\: '{print $1}'`
+ [ -z "$OSM_VCA_HOST" ] && FATAL "Cannot obtain juju controller IP address"
+ fi
+
+ if sudo iptables -t nat -C PREROUTING -p tcp -m tcp --dport 17070 -j DNAT --to-destination $OSM_VCA_HOST; then
+ sudo iptables -t nat -D PREROUTING -p tcp -m tcp --dport 17070 -j DNAT --to-destination $OSM_VCA_HOST
+ sudo netfilter-persistent save
+ fi
+}
+