diff --git a/diskimage-create/diskimage-create.sh b/diskimage-create/diskimage-create.sh index 1d9aa11fd4..3cc7426b35 100755 --- a/diskimage-create/diskimage-create.sh +++ b/diskimage-create/diskimage-create.sh @@ -207,6 +207,9 @@ AMP_ARCH=${AMP_ARCH:-"amd64"} AMP_BACKEND=${AMP_BACKEND:-"haproxy-octavia"} AMP_CACHEDIR=${AMP_CACHEDIR:-"$HOME/.cache/image-create"} +# Make sure we have an absolute path for the cache location +mkdir -p $AMP_CACHEDIR +AMP_CACHEDIR="$( cd "$AMP_CACHEDIR" && pwd )" AMP_BASEOS=${AMP_BASEOS:-"ubuntu-minimal"} @@ -307,7 +310,7 @@ fi if [ "$platform" = 'NAME="Ubuntu"' ]; then PKG_LIST="qemu-utils git kpartx debootstrap" for pkg in $PKG_LIST; do - if ! dpkg --get-selections | grep -q "^$pkg[[:space:]]*install$" >/dev/null; then + if ! dpkg --get-selections 2> /dev/null | grep -q "^$pkg[[:space:]]*install$" >/dev/null; then echo "Required package " $pkg " is not installed. Exiting." echo "Binary dependencies on this platform are: ${PKG_LIST}" exit 1 @@ -436,3 +439,9 @@ disk-image-create $AMP_LOGFILE $dib_trace_arg -a $AMP_ARCH -o $AMP_OUTPUTFILENAM popd > /dev/null # out of $TEMP rm -rf $TEMP + +if [ -z "$DIB_REPOREF_amphora_agent" ]; then + echo "Successfully built the amphora image using amphora-agent from the master branch." +else + echo "Successfully built the amphora using the $DIB_REPOREF_amphora_agent amphora-agent." +fi diff --git a/diskimage-create/tox.ini b/diskimage-create/tox.ini index 6703c247f5..1d1c75828e 100644 --- a/diskimage-create/tox.ini +++ b/diskimage-create/tox.ini @@ -7,7 +7,7 @@ skipsdist = True basepython = python3 envdir = {toxworkdir}/venv setenv = VIRTUAL_ENV={envdir} -passenv = http_proxy HTTP_PROXY https_proxy HTTPS_PROXY no_proxy NO_PROXY +passenv = http_proxy HTTP_PROXY https_proxy HTTPS_PROXY no_proxy NO_PROXY DIB_* CLOUD_INIT_DATASOURCES OCTAVIA_REPO_PATH install_command = pip install -U {opts} {packages} deps = -r{toxinidir}/requirements.txt -r{toxinidir}/test-requirements.txt @@ -27,8 +27,7 @@ commands = bashate diskimage-create.sh [testenv:build] # NOTE: specify cache directory explicitly with -c as the `diskimage-create.sh` # default is based off of `$HOME` which is not passed on in a `tox` environment. -commands = mkdir -p {toxinidir}/.amp_tox_test - ./diskimage-create.sh -o {toxinidir}/.amp_tox_test/amphora-x64-haproxy -w {toxworkdir} -c {toxworkdir}/.cache +commands = ./diskimage-create.sh -o {toxinidir}/amphora-x64-haproxy -w {toxworkdir} -c {toxworkdir}/.cache [testenv:test] # Work around tox limitations with command pipes