X-Git-Url: https://gerrit.linuxfoundation.org/infra/gitweb?a=blobdiff_plain;f=shell%2Fopenstack-cleanup-orphaned-servers.sh;h=4dad6ed0f9b90a289d7b3d681143fddc8117497d;hb=a8c7722c19cfca9f0361c578ce63bf552093dd0e;hp=629a3a0fd2226c5e6ca082fc7b65491f749ef08b;hpb=f0aba8bb5ffd86b4bd9f9e36f7d36d1ff9531983;p=releng%2Fglobal-jjb.git diff --git a/shell/openstack-cleanup-orphaned-servers.sh b/shell/openstack-cleanup-orphaned-servers.sh index 629a3a0f..4dad6ed0 100644 --- a/shell/openstack-cleanup-orphaned-servers.sh +++ b/shell/openstack-cleanup-orphaned-servers.sh @@ -47,6 +47,29 @@ minion_in_jenkins() { return 1 } +# shellcheck disable=SC1090 +source ~/lf-env.sh + +# Check if openstack venv was previously created +if [ -f "/tmp/.os_lf_venv" ]; then + os_lf_venv=$(cat "/tmp/.os_lf_venv") +fi + +if [ -d "${os_lf_venv}" ] && [ -f "${os_lf_venv}/bin/openstack" ]; then + echo "Re-use existing venv: ${os_lf_venv}" + PATH=$os_lf_venv/bin:$PATH +else + lf-activate-venv --python python3 "cryptography<3.4" \ + "lftools[openstack]" \ + kubernetes \ + "niet~=1.4.2" \ + python-heatclient \ + python-openstackclient \ + python-magnumclient \ + setuptools \ + "openstacksdk<0.99" \ + yq +fi ########################## ## FETCH ACTIVE MINIONS ## ##########################