Cleanup after tox_install run

Do not leave content in /tmp of checked out repositories, cleanup after
installing. This is needed since some jobs - like translation sync - are
run on long-lived nodes and if several projects use the same directories
in /tmp, this might cause jobs failing.

Therefore use temporary directory for installation - and place this
in source directory so that git clean can remove it.

Blacklist this temporary directory from pep8 invocations.

Change-Id: Ided3cb0335a13d4791df6f22c60db4a0d79ebc88
stable/ocata
Andreas Jaeger 6 years ago
parent f67975d724
commit 975cc2ad64

@ -33,8 +33,12 @@ elif [ $neutron_installed -eq 0 ]; then
echo "ALREADY INSTALLED at $location"
elif [ -x "$ZUUL_CLONER" ]; then
echo "USING ZUUL CLONER to obtain Neutron code"
cwd=$(/bin/pwd)
cd /tmp
# Make this relative to current working directory so that
# git clean can remove it. We cannot remove the directory directly
# since it is referenced after $install_cmd -e.
mkdir -p .tmp
NEUTRON_DIR=$(/bin/mktemp -d -p $(pwd)/.tmp)
pushd $NEUTRON_DIR
$ZUUL_CLONER --cache-dir \
/opt/git \
--branch $BRANCH_NAME \
@ -42,7 +46,7 @@ elif [ -x "$ZUUL_CLONER" ]; then
openstack/neutron
cd openstack/neutron
$install_cmd -e .
cd "$cwd"
popd
else
echo "LOCAL - Obtaining Neutron code from git.openstack.org"
$install_cmd -U -egit+https://git.openstack.org/openstack/neutron@$BRANCH_NAME#egg=neutron

@ -44,7 +44,7 @@ commands = python setup.py build_sphinx
show-source = True
ignore = E123,H803,H302,H904
builtins = _
exclude=.venv,.git,.tox,dist,doc,*lib/python*,*egg,build
exclude=.venv,.git,.tox,dist,doc,*lib/python*,*egg,build,.tmp
[testenv:api]
setenv = OS_TEST_PATH=./networking_l2gw/tests/api

Loading…
Cancel
Save