Skip to content
Snippets Groups Projects
Commit b88f4949 authored by israelad's avatar israelad
Browse files

Fix race condition


This fixes a race condition where cloud-init may not be finished before
we try to run apt-get update, causing the script to fail.

Fixes bug #463

Signed-off-by: default avatarAdam Israel <adam.israel@canonical.com>
Change-Id: I241d769bb5d3f07d1ede628df58f7949649eefd9
parent e2c017e4
No related branches found
No related tags found
No related merge requests found
......@@ -35,6 +35,9 @@ function cache() {
# 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"
# Wait for cloud-init to finish
lxc exec $container -- bash -c "while [ ! -f /var/lib/cloud/instance/boot-finished ]; do sleep 1; done"
lxc exec $container -- apt-get update -y
lxc exec $container -- apt-get upgrade -y
lxc exec $container -- apt-get install -y $PACKAGES $2
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment