openqa etc: reinstall local Python libs when Python ver changes
In openqa/dispatcher, relvalconsumer and check-compose roles, we install Python libraries from git checkouts (these are things we don't really want to package as they change too much). This enhances those roles so that we check whether pip considers the libraries to be installed, and install them if it doesn't. The purpose is to catch when the Python version rolls over on system upgrade, and reinstall the libraries in that case - I got bitten by this when upgrading to F32, I forgot to reinstall these libs for Python 3.8, and it broke things for a couple of days before I noticed and fixed it manually... Signed-off-by: Adam Williamson <awilliam@redhat.com>
This commit is contained in:
parent
9e61fa2b0b
commit
2b6c8be5aa
3 changed files with 23 additions and 8 deletions
|
@ -110,7 +110,8 @@
|
|||
|
||||
- name: Install required packages
|
||||
package:
|
||||
name: ['fedora-messaging', 'python3-fedfind', 'python3-openqa_client', 'python3-setuptools']
|
||||
name: ['fedora-messaging', 'python3-fedfind', 'python3-openqa_client', 'python3-setuptools',
|
||||
'python3-pip']
|
||||
state: present
|
||||
tags:
|
||||
- packages
|
||||
|
@ -121,11 +122,18 @@
|
|||
dest: /root/check-compose
|
||||
register: gitcc
|
||||
|
||||
- name: Check if check-compose is installed for current Python
|
||||
command: "pip show check_compose"
|
||||
register: instcc
|
||||
changed_when: "1 != 1"
|
||||
failed_when: "1 != 1"
|
||||
check_mode: no
|
||||
|
||||
- name: Install check-compose
|
||||
command: "python3 setup.py install --nodeps"
|
||||
args:
|
||||
chdir: /root/check-compose
|
||||
when: "gitcc is changed"
|
||||
when: "gitcc is changed or instcc.rc != 0"
|
||||
notify:
|
||||
- restart check-compose
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue