Improve python version detection when symlinking libraries
The previous code assumed that the major version ('python3') could be obtained by removing the last two characters from 'python3.X. This does not work for pyhton releases 3.10 and onward, so this patch changes the code to split the string on '.' and take the first portion. Change-Id: I771cac2fc9badb61c22cfde65775aee97c31f89c
This commit is contained in:
parent
908e3ac7b1
commit
43d785eff2
@ -23,7 +23,7 @@
|
|||||||
|
|
||||||
- name: Search for lib files to link
|
- name: Search for lib files to link
|
||||||
vars:
|
vars:
|
||||||
_venv_python_major_version: "{{ (_python_venv_details.files[0].path | basename)[:-2] }}"
|
_venv_python_major_version: "{{ (_python_venv_details.files[0].path | basename | split('.') )[0] }}"
|
||||||
shell: >-
|
shell: >-
|
||||||
{{ (ansible_facts['pkg_mgr'] == 'apt') | ternary('dpkg -L ' ~ (venv_packages_to_symlink | join(' ')), 'rpm -ql ' ~ (venv_packages_to_symlink | join(' ')) ) }}
|
{{ (ansible_facts['pkg_mgr'] == 'apt') | ternary('dpkg -L ' ~ (venv_packages_to_symlink | join(' ')), 'rpm -ql ' ~ (venv_packages_to_symlink | join(' ')) ) }}
|
||||||
| egrep '^.*{{ _venv_python_major_version }}.*/(site|dist)-packages/.*'
|
| egrep '^.*{{ _venv_python_major_version }}.*/(site|dist)-packages/.*'
|
||||||
|
Loading…
Reference in New Issue
Block a user