Use PyMySQL and venv path when caching subunit2sql

Also rename the element to one which runs in the context of the
diskimage chroot rather than in the root context, and make it
executable.

Change-Id: I093d02706f2965e071e2a76ab1131ac29016d03c
This commit is contained in:
Jeremy Stanley
2015-01-12 23:31:53 +00:00
parent 05e6bfaa10
commit b70a27d6c4
3 changed files with 5 additions and 5 deletions

View File

@@ -22,9 +22,9 @@ TEMPEST_DIR=$TMP_MOUNT_PATH/opt/git/openstack/tempest
# Setup venv and Install python deps from pip
sudo virtualenv /opt/git/subunit2sql-env
sudo -H /opt/git/subunit2sql-env/bin/pip install -U subunit2sql testrepository
sudo -H /opt/git/subunit2sql-env/bin/pip install -U subunit2sql testrepository PyMySQL
sudo /opt/git/subunit2sql-env/bin/python2 /opt/nodepool-scripts/prepare_tempest_testrepository.py $TEMPEST_DIR
sudo env PATH=/opt/git/subunit2sql-env/bin:$PATH /opt/git/subunit2sql-env/bin/python2 /opt/nodepool-scripts/prepare_tempest_testrepository.py $TEMPEST_DIR
# Delete the venv after the script
sudo rm -rf /opt/git/subunit2sql-env

View File

@@ -27,10 +27,10 @@ sudo -u jenkins -i /opt/nodepool-scripts/prepare_devstack.sh "$HOSTNAME"
# Setup venv and install deps for prepare_tempest_testrepository.py
sudo virtualenv -p python2 /opt/git/subunit2sql-env
sudo -H /opt/git/subunit2sql-env/bin/pip install -U testrepository subunit2sql
sudo -H /opt/git/subunit2sql-env/bin/pip install -U testrepository subunit2sql PyMySQL
# Pre-seed tempest testrepository with data from subunit2sql
sudo -i /opt/git/subunit2sql-env/bin/python2 /opt/nodepool-scripts/prepare_tempest_testrepository.py $TEMPEST_DIR
sudo -i env PATH=/opt/git/subunit2sql-env/bin:$PATH /opt/git/subunit2sql-env/bin/python2 /opt/nodepool-scripts/prepare_tempest_testrepository.py $TEMPEST_DIR
# Dekete the venv after the script is called
sudo rm -rf /opt/git/subunit2sql-env

View File

@@ -24,7 +24,7 @@ from subunit2sql import write_subunit
from common import run_local
DB_URI = 'mysql://query:query@logstash.openstack.org/subunit2sql'
DB_URI = 'mysql+pymysql://query:query@logstash.openstack.org/subunit2sql'
if len(sys.argv) == 2:
TEMPEST_PATH = sys.argv[1]