From: Adam Israel Date: Mon, 24 Apr 2017 16:53:09 +0000 (-0400) Subject: Fix a race condition that would cause the lxd image caching to fail if X-Git-Tag: v2.0.0~11 X-Git-Url: https://osm.etsi.org/gitweb/?a=commitdiff_plain;h=32a79fc47428f57ee4c706758f5ac568419674cc;p=osm%2Fdevops.git Fix a race condition that would cause the lxd image caching to fail if the network interface doesn't have an ip address fast enough. Signed-off-by: Adam Israel Change-Id: I5a81ebd0456c509e479461e9d5149a309b960d25 --- diff --git a/jenkins/VCA/update-lxd-image.sh b/jenkins/VCA/update-lxd-image.sh index ce14b1dc..182a33c2 100755 --- a/jenkins/VCA/update-lxd-image.sh +++ b/jenkins/VCA/update-lxd-image.sh @@ -28,7 +28,9 @@ function cache() { lxc delete $container -f || true lxc launch ubuntu:$series $container - sleep 5 # wait for network + + # Wait for the container to get an IP address + lxc exec $container -- bash -c "for i in {1..60}; do sleep 1; ping -c1 10.44.127.1 &> /dev/null && break; done" lxc exec $container -- apt-get update -y lxc exec $container -- apt-get upgrade -y