Wait until background apt process finishes before trying to install
anything and failing to get /var/lib/dpkg/lock lock.
https://lists.opendaylight.org/pipermail/integration-dev/2017-April/009485.html
Fixes both test-deb and test-ansible-deb jobs.
Change-Id: I5927b0f52d54cd7fd4332a43af5f630c12564ca5
Signed-off-by: Daniel Farrell <dfarrell@redhat.com>
source deb_build/bin/activate
pip install --upgrade pip
+# Wait for any background apt processes to finish
+# There seems to be a backgroud apt process that locks /var/lib/dpkg/lock
+# and causes our apt commands to fail.
+while pgrep apt > /dev/null; do sleep 1; done
+
# Install latest ansible
sudo apt-add-repository ppa:ansible/ansible
sudo apt-get update
# -o pipefail: Fail on errors in scripts this calls, give stacktrace
set -ex -o pipefail
+# Wait for any background apt processes to finish
+# There seems to be a backgroud apt process that locks /var/lib/dpkg/lock
+# and causes our apt commands to fail.
+while pgrep apt > /dev/null; do sleep 1; done
+
# Install ODL from .deb link or .repo url
if [[ $URL == *.deb ]]
then