Fix rados linking for py3

This patch detects correct lib path of gnocchi and use it for symlink
destination

Change-Id: I7b88a053ac5d779bc53a32c1294e76e2233cdd9e
This commit is contained in:
Dmitriy Rabotyagov 2020-05-04 06:06:56 +03:00
parent 7f53a9d0ad
commit 26637323d5
1 changed files with 7 additions and 2 deletions

View File

@ -14,14 +14,19 @@
# limitations under the License.
- name: Register rados module path
command: python -c 'import rados; print rados.__file__'
command: "{{ gnocchi_venv_python_executable }} -c 'import rados; print(rados.__file__)'"
changed_when: false
register: rados_module_path
- name: Register gnocchi lib path
command: "{{ gnocchi_bin }}/python -c 'import gnocchi; print(gnocchi.__file__)'"
changed_when: false
register: gnocchi_module_path
- name: Link rados module into the venv
file:
src: "{{ rados_module_path.stdout }}"
dest: "{{ gnocchi_bin | dirname }}/lib/python2.7/site-packages/{{ rados_module_path.stdout | basename }}"
dest: "{{ gnocchi_module_path.stdout | dirname | dirname }}/{{ rados_module_path.stdout | basename }}"
state: link
force: "yes"
notify: