mirror of
https://github.com/ansible/awx.git
synced 2026-02-25 15:06:02 -03:30
Add script wrapper to establish Tower SCL and venv before running Python
This commit is contained in:
18
tools/scripts/tower-python
Executable file
18
tools/scripts/tower-python
Executable file
@@ -0,0 +1,18 @@
|
|||||||
|
#!/bin/bash
|
||||||
|
|
||||||
|
# Enable needed Software Collections, if installed
|
||||||
|
for scl in python27 httpd24; do
|
||||||
|
if [ -f /etc/scl/prefixes/$scl ]; then
|
||||||
|
if [ -f `cat /etc/scl/prefixes/$scl`/$scl/enable ]; then
|
||||||
|
. `cat /etc/scl/prefixes/$scl`/$scl/enable
|
||||||
|
fi
|
||||||
|
fi
|
||||||
|
done
|
||||||
|
|
||||||
|
# Enable Tower virtualenv
|
||||||
|
if [ -f /var/lib/awx/venv/tower/bin/activate ]; then
|
||||||
|
. /var/lib/awx/venv/tower/bin/activate
|
||||||
|
fi
|
||||||
|
|
||||||
|
# Run the requested Python command, using the interpreter from the path
|
||||||
|
python "$@"
|
||||||
Reference in New Issue
Block a user