From 26637323d5411893af28a190595054e74baa4aec Mon Sep 17 00:00:00 2001 From: Dmitriy Rabotyagov Date: Mon, 4 May 2020 06:06:56 +0300 Subject: [PATCH] Fix rados linking for py3 This patch detects correct lib path of gnocchi and use it for symlink destination Change-Id: I7b88a053ac5d779bc53a32c1294e76e2233cdd9e --- tasks/gnocchi_ceph_python_libs.yml | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/tasks/gnocchi_ceph_python_libs.yml b/tasks/gnocchi_ceph_python_libs.yml index d4600ce..7e6af16 100644 --- a/tasks/gnocchi_ceph_python_libs.yml +++ b/tasks/gnocchi_ceph_python_libs.yml @@ -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: