From b1535bf279071cf9c95b52d6961d0f9b2162ce17 Mon Sep 17 00:00:00 2001 From: John Trowbridge Date: Wed, 15 Jun 2016 12:00:30 -0400 Subject: [PATCH] Use quickstart.sh to manage venv in all ci-scripts We currently have a step to activate the venv in the collect-logs, get-node, and return-node scripts. The collect-logs script does not need it at all anymore, and the {get,return}-node scripts can instead pull in python-cicoclient via a requirements file. Change-Id: I9754eae93942d9a89f77c0a2d8cc9839c537c39d --- ci-scripts/ci-base-requirements.txt | 1 + ci-scripts/collect-logs.sh | 5 ----- ci-scripts/get-node.sh | 12 +++--------- ci-scripts/return-node.sh | 9 ++------- 4 files changed, 6 insertions(+), 21 deletions(-) create mode 100644 ci-scripts/ci-base-requirements.txt diff --git a/ci-scripts/ci-base-requirements.txt b/ci-scripts/ci-base-requirements.txt new file mode 100644 index 000000000..1c92f1fac --- /dev/null +++ b/ci-scripts/ci-base-requirements.txt @@ -0,0 +1 @@ +python-cicoclient \ No newline at end of file diff --git a/ci-scripts/collect-logs.sh b/ci-scripts/collect-logs.sh index 5b7b5d14e..c7fd1cfc7 100644 --- a/ci-scripts/collect-logs.sh +++ b/ci-scripts/collect-logs.sh @@ -7,11 +7,6 @@ export ANSIBLE_INVENTORY=$WORKSPACE/hosts export ANSIBLE_CONFIG=$WORKSPACE/tripleo-quickstart/ansible.cfg export SSH_CONFIG=$WORKSPACE/ssh.config.ansible export ANSIBLE_SSH_ARGS="-F ${SSH_CONFIG}" -# (trown) I don't totally understand why this is needed here, but activating -# the venv is failing otherwise. -export VIRTUAL_ENV_DISABLE_PROMPT=1 - -source $WORKSPACE/bin/activate # (trown) This is so that we ensure separate ssh sockets for # concurrent jobs. Without this, two jobs running in parallel diff --git a/ci-scripts/get-node.sh b/ci-scripts/get-node.sh index 5fe227eae..80fd06165 100644 --- a/ci-scripts/get-node.sh +++ b/ci-scripts/get-node.sh @@ -10,25 +10,19 @@ bash quickstart.sh \ --working-dir $WORKSPACE/ \ --no-clone \ --bootstrap \ + --requirements ci-scripts/ci-base-requirements.txt \ --playbook noop.yml \ localhost popd -# (trown) I don't totally understand why this is needed here, but activating -# the venv is failing otherwise. -export VIRTUAL_ENV_DISABLE_PROMPT=1 -source $WORKSPACE/bin/activate - -pip install python-cicoclient - -cico node get --arch x86_64 \ +$WORKSPACE/bin/cico node get --arch x86_64 \ --release 7 \ --count 1 \ --retry-count 2 \ --retry-interval 30 \ -f csv > $WORKSPACE/provisioned.csv -cico inventory +$WORKSPACE/bin/cico inventory cat $WORKSPACE/provisioned.csv export VIRTHOST=`cat provisioned.csv | tail -1 | cut -d "," -f 3| sed -e 's/"//g'` diff --git a/ci-scripts/return-node.sh b/ci-scripts/return-node.sh index 1ae7cb2c4..836aa2eb7 100644 --- a/ci-scripts/return-node.sh +++ b/ci-scripts/return-node.sh @@ -3,11 +3,6 @@ set -eux -# (trown) I don't totally understand why this is needed here, but activating -# the venv is failing otherwise. -export VIRTUAL_ENV_DISABLE_PROMPT=1 -source $WORKSPACE/bin/activate - VIRTHOST_KEY=$(head -n1 $WORKSPACE/cico_key.txt) -cico node done $VIRTHOST_KEY -cico inventory +$WORKSPACE/bin/cico node done $VIRTHOST_KEY +$WORKSPACE/bin/cico inventory