Only proceed to create static uplink if the router interface is already created

Change-Id: Ic63cbcb7aa0832aeadbf85c2470e7f259b378bab
This commit is contained in:
Alejandro Andreu 2017-03-15 19:18:37 +01:00
parent 22601bd38b
commit c19795a689

View File

@ -73,6 +73,11 @@ fi
# Create a port on the edge router and bind it to the veth pair # Create a port on the edge router and bind it to the veth pair
ROUTER_ID=$(midonet-cli -A -e router list | grep ${EDGE_ROUTER} | awk '{ print $2 }') ROUTER_ID=$(midonet-cli -A -e router list | grep ${EDGE_ROUTER} | awk '{ print $2 }')
while [ -z $(midonet-cli -A -e host ${HOST_ID} binding list | grep veth1 | awk '{ print $6}') ]; do
echo "ZzZ..."
sleep 5
done
PORT_ID=$(midonet-cli -A -e host ${HOST_ID} binding list | grep veth1 | awk '{ print $6}') PORT_ID=$(midonet-cli -A -e host ${HOST_ID} binding list | grep veth1 | awk '{ print $6}')
if [ -z "$(midonet-cli -A -e router ${ROUTER_ID} route list | grep "src 0.0.0.0/0 dst 0.0.0.0/0 gw ${VETH0_IP} port ${PORT_ID}")" ]; then if [ -z "$(midonet-cli -A -e router ${ROUTER_ID} route list | grep "src 0.0.0.0/0 dst 0.0.0.0/0 gw ${VETH0_IP} port ${PORT_ID}")" ]; then