X-Git-Url: https://gerrit.linuxfoundation.org/infra/gitweb?a=blobdiff_plain;f=shell%2Fopenstack-cleanup-old-images.sh;h=79eee278254748754a9736327eeb7b0dacd0c1ea;hb=refs%2Fchanges%2F50%2F72650%2F2;hp=8d1ddd5de6395a05d2750fb0259faddeb25b6d6b;hpb=a8c7722c19cfca9f0361c578ce63bf552093dd0e;p=releng%2Fglobal-jjb.git diff --git a/shell/openstack-cleanup-old-images.sh b/shell/openstack-cleanup-old-images.sh index 8d1ddd5d..79eee278 100644 --- a/shell/openstack-cleanup-old-images.sh +++ b/shell/openstack-cleanup-old-images.sh @@ -14,27 +14,16 @@ echo "---> Cleanup old images" # shellcheck disable=SC1090 source ~/lf-env.sh -set -x -# 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 +# TODO: "openstacksdk<0.99" AttributeError: 'Image' object has no +# attribute 'protected' +lf-activate-venv --python python3 "lftools[openstack]" \ + kubernetes \ + niet \ + "openstacksdk<0.99" \ + python-heatclient \ + python-openstackclient \ + python-magnumclient \ + yq os_cloud="${OS_CLOUD:-vex}" os_image_cleanup_age="${OS_IMAGE_CLEANUP_AGE:-30}"