Browse Source

Fix 'The `libvirt` module is not importable' error

Upper constraints were updated [1] to allow libvirt-python 7.5.0. The
first Kayobe builds using this version worked fine, but later they
started failing with the error:

    The `libvirt` module is not importable. Check the requirements.

The main difference is that successful jobs were using the source
archive libvirt-python-7.5.0.tar.gz, while failing jobs were using the
wheel libvirt_python-7.5.0-cp36-cp36m-linux_x86_64.whl.

Install libvirt-python from source to avoid this issue.

Update the ansible-lint configuration to ignore errors coming from the
stackhpc.libvirt-vm role, fixing the tenks-tox-ansible-lint job.

[1] https://review.opendev.org/c/openstack/requirements/+/799347

Change-Id: I746d01ed355330c965b90657264d89a4ef7995d2
changes/99/800199/5
Pierre Riteau 3 months ago
parent
commit
5746ed2a27
  1. 3
      .ansible-lint
  2. 4
      ansible/roles/virtualbmc-daemon/tasks/main.yml

3
.ansible-lint

@ -1,3 +1,6 @@
skip_list:
- '106' # Role name {} does not match ``^[a-z][a-z0-9_]+$`` pattern'
warn_list:
- experimental
- no-changed-when

4
ansible/roles/virtualbmc-daemon/tasks/main.yml

@ -34,9 +34,13 @@
# following error: Cannot uninstall 'PyYAML'. It is a distutils installed
# project and thus we cannot accurately determine which files belong to it
# which would lead to only a partial uninstall.
# NOTE(priteau): Use --no-binary to avoid installing libvirt-python from
# wheel. There is a problem with the 7.5.0 wheel resulting in the error:
# The `libvirt` module is not importable. Check the requirements.
extra_args: >-
-c {{ vbmcd_python_upper_constraints_url }}
{% if not vbmcd_virtualenv_path %}--ignore-installed PyYAML{% endif %}
--no-binary libvirt-python
virtualenv: "{{ vbmcd_virtualenv_path or omit }}"
register: result
until: result is success

Loading…
Cancel
Save