From d2e0d64eb00d4cea8a4f8ff6a963b1ec0c3660ac Mon Sep 17 00:00:00 2001
From: Pierre Riteau <pierre@stackhpc.com>
Date: Wed, 25 May 2022 09:41:01 +0200
Subject: [PATCH] Use yoga upper constraints to avoid Python version conflict

Requirements upper constraints bumped python-novaclient to version
18.0.0 [1], which requires Python 3.8 [2]. This results in failures when
installing python-openstackclient on CentOS and Rocky with Python 3.6.

    ERROR: Cannot install python-openstackclient==5.8.0 because these package versions have conflicting dependencies.

    The conflict is caused by:
        python-openstackclient 5.8.0 depends on python-novaclient>=17.0.0
        The user requested (constraint) python-novaclient===18.0.0

Work around this issue by using yoga upper constraints until we upgrade
to CentOS Stream 9 and Rocky Linux 9.

This also fixes another issue seen on Ubuntu where image uploads to
Glance through Ansible fail with a 400 Bad Request error. This is caused
by the bump of openstacksdk to version 0.99.0 and will be fixed by a new
release of ansible-collections-openstack.

[1] https://review.opendev.org/c/openstack/requirements/+/842808
[2] https://review.opendev.org/c/openstack/python-novaclient/+/838944

Change-Id: I40c6b898963c2218d41d37bd73d40ce8dcf22b87
---
 ansible/group_vars/all/pip                          | 2 +-
 dev/tenks-deploy-config-compute-libvirt-on-host.yml | 2 ++
 dev/tenks-deploy-config-compute.yml                 | 2 ++
 dev/tenks-deploy-config-overcloud.yml               | 2 ++
 playbooks/kayobe-overcloud-base/run.yml             | 1 +
 playbooks/kayobe-overcloud-upgrade-base/run.yml     | 2 ++
 zuul.d/jobs.yaml                                    | 1 +
 7 files changed, 11 insertions(+), 1 deletion(-)

diff --git a/ansible/group_vars/all/pip b/ansible/group_vars/all/pip
index 8a9c9056..928099ff 100644
--- a/ansible/group_vars/all/pip
+++ b/ansible/group_vars/all/pip
@@ -1,3 +1,3 @@
 ---
 # Upper constraints file for installation of python packages.
-pip_upper_constraints_file: "https://releases.openstack.org/constraints/upper/{{ openstack_release }}"
+pip_upper_constraints_file: "https://releases.openstack.org/constraints/upper/yoga"
diff --git a/dev/tenks-deploy-config-compute-libvirt-on-host.yml b/dev/tenks-deploy-config-compute-libvirt-on-host.yml
index d8cd1a14..7e636c65 100644
--- a/dev/tenks-deploy-config-compute-libvirt-on-host.yml
+++ b/dev/tenks-deploy-config-compute-libvirt-on-host.yml
@@ -54,3 +54,5 @@ libvirt_vm_emulator: "{% if ansible_facts.os_family == 'RedHat' %}/usr/libexec/q
 # Specify a log path in the kolla_logs Docker volume. It is accessible on the
 # host at the same path.
 libvirt_vm_default_console_log_dir: "/var/log/kolla/tenks"
+
+python_upper_constraints_url: "https://releases.openstack.org/constraints/upper/yoga"
diff --git a/dev/tenks-deploy-config-compute.yml b/dev/tenks-deploy-config-compute.yml
index 0f859ccd..79a4e073 100644
--- a/dev/tenks-deploy-config-compute.yml
+++ b/dev/tenks-deploy-config-compute.yml
@@ -55,3 +55,5 @@ libvirt_vm_default_console_log_dir: "/var/log/kolla/tenks"
 # Console logs are owned by the ID of the Nova user in the nova_libvirt
 # container.
 libvirt_vm_log_owner: 42436
+
+python_upper_constraints_url: "https://releases.openstack.org/constraints/upper/yoga"
diff --git a/dev/tenks-deploy-config-overcloud.yml b/dev/tenks-deploy-config-overcloud.yml
index 521f7d03..a3f0aa30 100644
--- a/dev/tenks-deploy-config-overcloud.yml
+++ b/dev/tenks-deploy-config-overcloud.yml
@@ -42,3 +42,5 @@ wait_for_placement: false
 # Nested virtualisation is not working well in CI currently. Force the use of
 # QEMU.
 libvirt_vm_engine: "qemu"
+
+python_upper_constraints_url: "https://releases.openstack.org/constraints/upper/yoga"
diff --git a/playbooks/kayobe-overcloud-base/run.yml b/playbooks/kayobe-overcloud-base/run.yml
index 350b47df..bf79cc05 100644
--- a/playbooks/kayobe-overcloud-base/run.yml
+++ b/playbooks/kayobe-overcloud-base/run.yml
@@ -5,6 +5,7 @@
     KAYOBE_OVERCLOUD_GENERATE_CERTIFICATES: "{{ tls_enabled | ternary(1, 0) }}"
     # TODO(mgoddard): Remove this when libvirt on host is used by default.
     TENKS_CONFIG_PATH: "dev/tenks-deploy-config-compute{% if tls_enabled %}-libvirt-on-host{% endif %}.yml"
+    UPPER_CONSTRAINTS_FILE: "https://releases.openstack.org/constraints/upper/yoga"
   tasks:
     - name: Ensure overcloud is deployed
       shell:
diff --git a/playbooks/kayobe-overcloud-upgrade-base/run.yml b/playbooks/kayobe-overcloud-upgrade-base/run.yml
index 97569e0b..9b13e538 100644
--- a/playbooks/kayobe-overcloud-upgrade-base/run.yml
+++ b/playbooks/kayobe-overcloud-upgrade-base/run.yml
@@ -1,5 +1,7 @@
 ---
 - hosts: primary
+  environment:
+    UPPER_CONSTRAINTS_FILE: "https://releases.openstack.org/constraints/upper/yoga"
   tasks:
 
     # Install the previous release of Kayobe, and use it to deploy a control
diff --git a/zuul.d/jobs.yaml b/zuul.d/jobs.yaml
index f14cb559..66042c06 100644
--- a/zuul.d/jobs.yaml
+++ b/zuul.d/jobs.yaml
@@ -71,6 +71,7 @@
       - name: openstack/kolla
       - name: openstack/kolla-ansible
       - name: openstack/requirements
+        override-checkout: stable/yoga
       - name: openstack/tenks
     irrelevant-files:
       - ^\..+
-- 
GitLab