X-Git-Url: https://gerrit.linuxfoundation.org/infra/gitweb?a=blobdiff_plain;f=shell%2Fopenstack-cleanup-orphaned-volumes.sh;h=f6d7534326337c9a5c57c4bdc94e09f7511e580e;hb=04853ec1c27444d494afae28e8c181b711280f4b;hp=c5cc0b2b8892d6e6e0c533b330477274bd23087f;hpb=a8c7722c19cfca9f0361c578ce63bf552093dd0e;p=releng%2Fglobal-jjb.git diff --git a/shell/openstack-cleanup-orphaned-volumes.sh b/shell/openstack-cleanup-orphaned-volumes.sh index c5cc0b2b..f6d75343 100644 --- a/shell/openstack-cleanup-orphaned-volumes.sh +++ b/shell/openstack-cleanup-orphaned-volumes.sh @@ -17,26 +17,15 @@ set -eux -o pipefail # 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 +lf-activate-venv --python python3 "lftools[openstack]" \ + kubernetes \ + niet \ + python-heatclient \ + python-openstackclient \ + python-magnumclient \ + yq + mapfile -t os_volumes < <(openstack --os-cloud "$os_cloud" volume list -f value -c ID --status Available) if [ ${#os_volumes[@]} -eq 0 ]; then