Ensure __pycache__ folder is deleted
When running python3, the cleanup of the virtualenv is incomplete: While the *.pyc files are removed, the python3 __pycache__ folder is not removed. That causes the sed instruction (applying to files) to fail, as the __pycache__ folder is not a regular file, but a folder. With the sed not successfully running, the shebang of the virtualenv is pointing to an incorrect location, causing then a failure in keystone-manage commands. On top of it, a success would happen should the last command return 0. We now make sure the whole script must return success. This should fix the problem. Change-Id: Id28fd1c4989bfff1d0d736c037b8f0e77eb082c1
This commit is contained in:
parent
fcf2b3e484
commit
f3f41ba8d9
|
@ -111,7 +111,9 @@
|
|||
# # to https://github.com/pypa/virtualenv/issues/565
|
||||
- name: Reset virtualenv and update its paths
|
||||
shell: |
|
||||
set -o errexit
|
||||
find {{ keystone_bin }} -name \*.pyc -delete
|
||||
if test -d {{ keystone_bin }}/__pycache__; then rmdir {{ keystone_bin }}/__pycache__; fi
|
||||
sed -si '1s/^.*python.*$/#!{{ keystone_bin | replace ('/','\/') }}\/python/' {{ keystone_bin }}/*
|
||||
virtualenv {{ keystone_bin | dirname }} \
|
||||
{{ (ansible_pkg_mgr == 'apt') | ternary('--always-copy', '') }} \
|
||||
|
|
Loading…
Reference in New Issue