nova/tools/with_venv.sh
Chet Burgess 4c891b9243 support reloctable venv roots in testing framework
run_tests.sh, with_venv.sh, and the install_venv.py scripts now
support relocating the venv root to another location.

All 3 scripts now support new envinroment variables to configure
the location of the venv and the tools directory. To maintain
compatability the defaults are set to the current values.

venv_path = Location of the virtualenv directory
	Default: $(pwd)

venv_name = Name of the virtualenv directory
	Default: .venv

tools_path = Location of the tools directory
	Default: $(pwd)

Additionally the run_tests.sh script also takes these value as
arguments and will pass them along accordingly.

--virtual-env-path <path>   Location of the virtualenv directory
                             Default: $(pwd)
--virtual-env-name <name>   Name of the virtualenv directory
                             Default: .venv
--tools-path <dir>          Location of the tools directory
                             Default: $(pwd)

DocImpact

Change-Id: I1be036058227206ecca342f692cd3d6aadb24069
Fixes: bug #1116942
2013-02-07 12:38:45 -08:00

8 lines
218 B
Bash
Executable File

#!/bin/bash
tools_path=${tools_path:-$(dirname $0)}
venv_path=${venv_path:-${tools_path}}
venv_dir=${venv_name:-/../.venv}
TOOLS=${tools_path}
VENV=${venv:-${venv_path}/${venv_dir}}
source ${VENV}/bin/activate && "$@"