Merge "Ensure python3 compatibility"
This commit is contained in:
commit
b163404e4e
@ -20,44 +20,37 @@
|
|||||||
# use the distro packages for these and symlink the appropriate
|
# use the distro packages for these and symlink the appropriate
|
||||||
# library files and binding into the venv.
|
# library files and binding into the venv.
|
||||||
|
|
||||||
- name: Link guestfs into the venv
|
- name: Find the venv's python version
|
||||||
file:
|
find:
|
||||||
src: "{{ linkfiles.name }}"
|
paths: "{{ nova_bin | dirname }}/lib/"
|
||||||
dest: "{{ nova_bin | dirname }}/lib/python2.7/{{ linkfiles.name | basename }}"
|
patterns: "python*"
|
||||||
state: "{{ linkfiles.state }}"
|
file_type: directory
|
||||||
force: "yes"
|
recurse: no
|
||||||
with_items:
|
register: python_venv_details
|
||||||
- { state: link, name: "/usr/lib/python2.7/dist-packages/libguestfsmod.so" }
|
|
||||||
- { state: link, name: "/usr/lib/python2.7/dist-packages/guestfs.py" }
|
|
||||||
loop_control:
|
|
||||||
loop_var: linkfiles
|
|
||||||
tags:
|
|
||||||
- nova-pip-packages
|
|
||||||
|
|
||||||
- name: Register libvirt module path
|
- name: Set python venvs details
|
||||||
command: python -c 'import libvirt; print libvirt.__file__'
|
set_fact:
|
||||||
changed_when: false
|
venv_python_version: "{{ (python_venv_details.files[0].path | basename) }}"
|
||||||
register: _libvirt_module_path
|
venv_python_major_version: "{{ (python_venv_details.files[0].path | basename)[:-2] }}"
|
||||||
tags:
|
venv_python_lib_folder: "{{ python_venv_details.files[0].path }}"
|
||||||
- nova-pip-packages
|
|
||||||
|
|
||||||
- name: Register libvirt-python files
|
- name: Search for lib files to link
|
||||||
shell: >-
|
shell: >-
|
||||||
{{ (ansible_pkg_mgr == 'apt') | ternary('dpkg -L python-libvirt', 'rpm -ql libvirt-python') }}
|
{{ (ansible_pkg_mgr == 'apt') | ternary('dpkg -L ' ~ (nova_compute_kvm_packages_to_symlink | join(' ')), 'rpm -ql ' ~ (nova_compute_kvm_packages_to_symlink | join(' ')) ) }}
|
||||||
| grep '^{{ _libvirt_module_path.stdout | dirname }}/'
|
| egrep '^.*{{ venv_python_major_version }}.*/(site|dist)-packages/.*'
|
||||||
args:
|
args:
|
||||||
warn: no
|
warn: no
|
||||||
changed_when: false
|
changed_when: false
|
||||||
register: _libvirt_python_files
|
register: _python_files
|
||||||
tags:
|
tags:
|
||||||
- nova-pip-packages
|
- nova-pip-packages
|
||||||
|
|
||||||
- name: Link the libvirt files into venv
|
- name: Link the python host package files into venv
|
||||||
file:
|
file:
|
||||||
src: "{{ item }}"
|
src: "{{ item }}"
|
||||||
dest: "{{ nova_bin | dirname }}/lib/python2.7/site-packages/{{ item | basename }}"
|
dest: "{{ venv_python_lib_folder }}/site-packages/{{ item | basename }}"
|
||||||
state: link
|
state: link
|
||||||
force: yes
|
force: yes
|
||||||
with_items: "{{ _libvirt_python_files.stdout_lines }}"
|
with_items: "{{ _python_files.stdout_lines }}"
|
||||||
tags:
|
tags:
|
||||||
- nova-pip-packages
|
- nova-pip-packages
|
||||||
|
@ -87,6 +87,10 @@ nova_compute_kvm_distro_packages:
|
|||||||
- qemu-img-ev
|
- qemu-img-ev
|
||||||
- sysfsutils
|
- sysfsutils
|
||||||
|
|
||||||
|
nova_compute_kvm_packages_to_symlink:
|
||||||
|
- libvirt-python
|
||||||
|
- python-libguestfs
|
||||||
|
|
||||||
nova_compute_ksm_packages:
|
nova_compute_ksm_packages:
|
||||||
- ksmtuned
|
- ksmtuned
|
||||||
|
|
||||||
|
@ -97,6 +97,10 @@ nova_compute_kvm_distro_packages:
|
|||||||
- qemu-tools
|
- qemu-tools
|
||||||
- sysfsutils
|
- sysfsutils
|
||||||
|
|
||||||
|
nova_compute_kvm_packages_to_symlink:
|
||||||
|
- libvirt-python
|
||||||
|
- python-libguestfs
|
||||||
|
|
||||||
nova_compute_ksm_packages:
|
nova_compute_ksm_packages:
|
||||||
- qemu-ksm
|
- qemu-ksm
|
||||||
|
|
||||||
|
@ -81,7 +81,9 @@ nova_compute_kvm_distro_packages:
|
|||||||
- libvirt-bin
|
- libvirt-bin
|
||||||
- open-iscsi
|
- open-iscsi
|
||||||
- python-guestfs
|
- python-guestfs
|
||||||
|
- python3-guestfs
|
||||||
- python-libvirt
|
- python-libvirt
|
||||||
|
- python3-libvirt
|
||||||
- qemu
|
- qemu
|
||||||
- qemu-utils
|
- qemu-utils
|
||||||
- sysfsutils
|
- sysfsutils
|
||||||
@ -102,6 +104,12 @@ nova_compute_kvm_distro_packages:
|
|||||||
- qemu-user
|
- qemu-user
|
||||||
- qemu-kvm
|
- qemu-kvm
|
||||||
|
|
||||||
|
nova_compute_kvm_packages_to_symlink:
|
||||||
|
- python-libvirt
|
||||||
|
- python3-libvirt
|
||||||
|
- python-guestfs
|
||||||
|
- python3-guestfs
|
||||||
|
|
||||||
nova_compute_lxd_distro_packages:
|
nova_compute_lxd_distro_packages:
|
||||||
- bridge-utils
|
- bridge-utils
|
||||||
- dosfstools
|
- dosfstools
|
||||||
|
Loading…
x
Reference in New Issue
Block a user