From nobody Thu May 16 22:13:57 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of redhat.com designates 207.211.31.81 as permitted sender) client-ip=207.211.31.81; envelope-from=libvir-list-bounces@redhat.com; helo=us-smtp-delivery-1.mimecast.com; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 207.211.31.81 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=pass(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1585912857; cv=none; d=zohomail.com; s=zohoarc; b=N0j6V+jHOWGQLr1bTwvk53am3dk4GJjejQ1PmRoNFOOMwgdmMr8S1sKAyWGqRGQ/ZSXUPXUd85dgnPrQVc3Y9laJAIpoaiHxASctQc9Km8ixdObyMCI8YoJgQmfi/B2ySmg4X/H62q5VqrgZr4miXY39ZiuWPGm4HDN9p/9W/lo= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1585912857; h=Content-Type:Content-Transfer-Encoding:Date:From:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:Sender:Subject:To; bh=279B1TZDrRaDqSkJEK+aXXpqFkdCgQLHv29Iit3m4yA=; b=hA3bGJaFnAuScdmprRKwpgOd2H+vlGQnNGwgHdfnmSivT2g4c2L0drbza1C14Iq7E8jfvjt3/nTg2bAX7M7Oi4u06akqfzMY2/W+ikm5CRy/yt2zEzgXW6B94DdAcT5snlnG7iPKDl5Nzej7IWLjgVJgsObLcJ7y9Fr9EkfezhQ= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 207.211.31.81 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=pass header.from= (p=none dis=none) header.from= Return-Path: Received: from us-smtp-delivery-1.mimecast.com (us-smtp-1.mimecast.com [207.211.31.81]) by mx.zohomail.com with SMTPS id 1585912857088758.6269250856418; Fri, 3 Apr 2020 04:20:57 -0700 (PDT) Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-407-frYI-a2DOm6eNosjBcUcVA-1; Fri, 03 Apr 2020 07:20:51 -0400 Received: from smtp.corp.redhat.com (int-mx06.intmail.prod.int.phx2.redhat.com [10.5.11.16]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 1A2CF100550D; Fri, 3 Apr 2020 11:20:44 +0000 (UTC) Received: from colo-mx.corp.redhat.com (colo-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.20]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 387935C1B0; Fri, 3 Apr 2020 11:20:43 +0000 (UTC) Received: from lists01.pubmisc.prod.ext.phx2.redhat.com (lists01.pubmisc.prod.ext.phx2.redhat.com [10.5.19.33]) by colo-mx.corp.redhat.com (Postfix) with ESMTP id A90A41809567; Fri, 3 Apr 2020 11:20:39 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx08.intmail.prod.int.phx2.redhat.com [10.5.11.23]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id 033BJn6f011287 for ; Fri, 3 Apr 2020 07:19:49 -0400 Received: by smtp.corp.redhat.com (Postfix) id 5EFFB39E; Fri, 3 Apr 2020 11:19:49 +0000 (UTC) Received: from kinshicho.usersys.redhat.com (unknown [10.40.195.30]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 41CCD26569 for ; Fri, 3 Apr 2020 11:19:45 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1585912855; h=from:from:sender:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:mime-version:mime-version: content-type:content-type: content-transfer-encoding:content-transfer-encoding:list-id:list-help: list-unsubscribe:list-subscribe:list-post; bh=279B1TZDrRaDqSkJEK+aXXpqFkdCgQLHv29Iit3m4yA=; b=gnR1s38InmFN41eAavUBCYoAnYd4DC1FBhpU/Od4wF6CXPAU/WV7LrVP4zxWigWp6ogxrf bmnXJNgsmVyvibD/GaTpfdFOpq8Dk3EFpvY0yXyk3ucU9FhCDII7RdujK2uqh+LYJcjZmv 7JlIEa/ZdWo/H4CUwfQJbIdunF/BdxM= X-MC-Unique: frYI-a2DOm6eNosjBcUcVA-1 From: Andrea Bolognani To: libvir-list@redhat.com Subject: [libvirt-jenkins-ci PATCH] lcitool: Fix $PYTHON value in environment Date: Fri, 3 Apr 2020 13:19:41 +0200 Message-Id: <20200403111941.14625-1-abologna@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.84 on 10.5.11.23 X-loop: libvir-list@redhat.com X-BeenThere: libvir-list@redhat.com X-Mailman-Version: 2.1.12 Precedence: junk List-Id: Development discussions about the libvirt library & tools List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: libvir-list-bounces@redhat.com Errors-To: libvir-list-bounces@redhat.com X-Scanned-By: MIMEDefang 2.79 on 10.5.11.16 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Transfer-Encoding: quoted-printable X-ZohoMail-DKIM: pass (identity @redhat.com) Content-Type: text/plain; charset="utf-8" Starting with commit commit d76f41ece09b9aaf492553fe466c30a22c78e509 Author: Andrea Bolognani Date: Fri Mar 27 17:21:26 2020 +0100 lcitool: Include paths in the inventory Figuring them out at runtime is neat, but in practice they don't change frequently enough for it to be necessary; more importantly, including them in the inventory means we can use them in the Dockerfile generator in addition to the Ansible playbooks. Signed-off-by: Andrea Bolognani Reviewed-by: Daniel P. Berrang=C3=A9 we have hardcoded the path of the Python interpreter to be used for builds in the inventory; an unforeseen consequence of this change is that Python builds on CentOS 7 have started failing. The reason for that is simple, but not immediately obvious. While on most target platforms we have a single Python interpreter installed, on CentOS 7 we still need two: Python 3 works fine when it comes to building projects, but it's missing a bunch of modules that Ansible needs to run, so we're stuck with Python 2 for Ansible use. This has worked fine for us so far. As part of the change above, however, due to a naming clash we have ended up in a situation where the bootstrap task, which installs a Python suitable for Ansible, overrides the Python intended for builds as set in the inventory. Of course this would result in breakages only on CentOS 7, where the two Pythons differ. Fix this by removing the runtime detection from the bootstrap task and storing the relevant information in the inventory. Signed-off-by: Andrea Bolognani Reviewed-by: Daniel P. Berrang=C3=A9 --- guests/host_vars/libvirt-centos-7/main.yml | 1 + guests/host_vars/libvirt-centos-8/main.yml | 1 + guests/host_vars/libvirt-debian-10/main.yml | 1 + guests/host_vars/libvirt-debian-9/main.yml | 1 + guests/host_vars/libvirt-debian-sid/main.yml | 1 + guests/host_vars/libvirt-fedora-30/main.yml | 1 + guests/host_vars/libvirt-fedora-31/main.yml | 1 + guests/host_vars/libvirt-fedora-rawhide/main.yml | 1 + guests/host_vars/libvirt-freebsd-11/main.yml | 1 + guests/host_vars/libvirt-freebsd-12/main.yml | 1 + guests/host_vars/libvirt-freebsd-current/main.yml | 1 + guests/host_vars/libvirt-opensuse-151/main.yml | 1 + guests/host_vars/libvirt-ubuntu-1604/main.yml | 1 + guests/host_vars/libvirt-ubuntu-1804/main.yml | 1 + guests/playbooks/update/tasks/bootstrap.yml | 11 +---------- 15 files changed, 15 insertions(+), 10 deletions(-) diff --git a/guests/host_vars/libvirt-centos-7/main.yml b/guests/host_vars/= libvirt-centos-7/main.yml index f1fef44..104b702 100644 --- a/guests/host_vars/libvirt-centos-7/main.yml +++ b/guests/host_vars/libvirt-centos-7/main.yml @@ -30,4 +30,5 @@ python: /usr/bin/python3 su: /bin/su sudoers: /etc/sudoers =20 +ansible_python_package: python2 ansible_python_interpreter: /usr/bin/python2 diff --git a/guests/host_vars/libvirt-centos-8/main.yml b/guests/host_vars/= libvirt-centos-8/main.yml index 48edb78..441802c 100644 --- a/guests/host_vars/libvirt-centos-8/main.yml +++ b/guests/host_vars/libvirt-centos-8/main.yml @@ -30,4 +30,5 @@ python: /usr/bin/python3 su: /bin/su sudoers: /etc/sudoers =20 +ansible_python_package: python3 ansible_python_interpreter: /usr/bin/python3 diff --git a/guests/host_vars/libvirt-debian-10/main.yml b/guests/host_vars= /libvirt-debian-10/main.yml index 37036e6..e3aca55 100644 --- a/guests/host_vars/libvirt-debian-10/main.yml +++ b/guests/host_vars/libvirt-debian-10/main.yml @@ -32,4 +32,5 @@ python: /usr/bin/python3 su: /bin/su sudoers: /etc/sudoers =20 +ansible_python_package: python3 ansible_python_interpreter: /usr/bin/python3 diff --git a/guests/host_vars/libvirt-debian-9/main.yml b/guests/host_vars/= libvirt-debian-9/main.yml index b46efd1..0599aa4 100644 --- a/guests/host_vars/libvirt-debian-9/main.yml +++ b/guests/host_vars/libvirt-debian-9/main.yml @@ -32,4 +32,5 @@ python: /usr/bin/python3 su: /bin/su sudoers: /etc/sudoers =20 +ansible_python_package: python3 ansible_python_interpreter: /usr/bin/python3 diff --git a/guests/host_vars/libvirt-debian-sid/main.yml b/guests/host_var= s/libvirt-debian-sid/main.yml index 36045cd..565b0be 100644 --- a/guests/host_vars/libvirt-debian-sid/main.yml +++ b/guests/host_vars/libvirt-debian-sid/main.yml @@ -32,4 +32,5 @@ python: /usr/bin/python3 su: /bin/su sudoers: /etc/sudoers =20 +ansible_python_package: python3 ansible_python_interpreter: /usr/bin/python3 diff --git a/guests/host_vars/libvirt-fedora-30/main.yml b/guests/host_vars= /libvirt-fedora-30/main.yml index 71b8e7b..d31a84a 100644 --- a/guests/host_vars/libvirt-fedora-30/main.yml +++ b/guests/host_vars/libvirt-fedora-30/main.yml @@ -45,4 +45,5 @@ python: /usr/bin/python3 su: /bin/su sudoers: /etc/sudoers =20 +ansible_python_package: python3 ansible_python_interpreter: /usr/bin/python3 diff --git a/guests/host_vars/libvirt-fedora-31/main.yml b/guests/host_vars= /libvirt-fedora-31/main.yml index c692715..389cfac 100644 --- a/guests/host_vars/libvirt-fedora-31/main.yml +++ b/guests/host_vars/libvirt-fedora-31/main.yml @@ -33,4 +33,5 @@ python: /usr/bin/python3 su: /bin/su sudoers: /etc/sudoers =20 +ansible_python_package: python3 ansible_python_interpreter: /usr/bin/python3 diff --git a/guests/host_vars/libvirt-fedora-rawhide/main.yml b/guests/host= _vars/libvirt-fedora-rawhide/main.yml index bea4ad1..374cb4c 100644 --- a/guests/host_vars/libvirt-fedora-rawhide/main.yml +++ b/guests/host_vars/libvirt-fedora-rawhide/main.yml @@ -33,4 +33,5 @@ python: /usr/bin/python3 su: /bin/su sudoers: /etc/sudoers =20 +ansible_python_package: python3 ansible_python_interpreter: /usr/bin/python3 diff --git a/guests/host_vars/libvirt-freebsd-11/main.yml b/guests/host_var= s/libvirt-freebsd-11/main.yml index 7fbab39..c289221 100644 --- a/guests/host_vars/libvirt-freebsd-11/main.yml +++ b/guests/host_vars/libvirt-freebsd-11/main.yml @@ -31,4 +31,5 @@ python: /usr/local/bin/python3 su: /usr/bin/su sudoers: /usr/local/etc/sudoers =20 +ansible_python_package: python3 ansible_python_interpreter: /usr/local/bin/python3 diff --git a/guests/host_vars/libvirt-freebsd-12/main.yml b/guests/host_var= s/libvirt-freebsd-12/main.yml index abedd95..3bc3cc6 100644 --- a/guests/host_vars/libvirt-freebsd-12/main.yml +++ b/guests/host_vars/libvirt-freebsd-12/main.yml @@ -31,4 +31,5 @@ python: /usr/local/bin/python3 su: /usr/bin/su sudoers: /usr/local/etc/sudoers =20 +ansible_python_package: python3 ansible_python_interpreter: /usr/local/bin/python3 diff --git a/guests/host_vars/libvirt-freebsd-current/main.yml b/guests/hos= t_vars/libvirt-freebsd-current/main.yml index 9b0ba1f..02297e0 100644 --- a/guests/host_vars/libvirt-freebsd-current/main.yml +++ b/guests/host_vars/libvirt-freebsd-current/main.yml @@ -31,4 +31,5 @@ python: /usr/local/bin/python3 su: /usr/bin/su sudoers: /usr/local/etc/sudoers =20 +ansible_python_package: python3 ansible_python_interpreter: /usr/local/bin/python3 diff --git a/guests/host_vars/libvirt-opensuse-151/main.yml b/guests/host_v= ars/libvirt-opensuse-151/main.yml index 3e674cc..656de36 100644 --- a/guests/host_vars/libvirt-opensuse-151/main.yml +++ b/guests/host_vars/libvirt-opensuse-151/main.yml @@ -31,4 +31,5 @@ python: /usr/bin/python3 su: /bin/su sudoers: /etc/sudoers =20 +ansible_python_package: python3 ansible_python_interpreter: /usr/bin/python3 diff --git a/guests/host_vars/libvirt-ubuntu-1604/main.yml b/guests/host_va= rs/libvirt-ubuntu-1604/main.yml index 1eb2345..476d7ed 100644 --- a/guests/host_vars/libvirt-ubuntu-1604/main.yml +++ b/guests/host_vars/libvirt-ubuntu-1604/main.yml @@ -31,4 +31,5 @@ python: /usr/bin/python3 su: /bin/su sudoers: /etc/sudoers =20 +ansible_python_package: python3 ansible_python_interpreter: /usr/bin/python3 diff --git a/guests/host_vars/libvirt-ubuntu-1804/main.yml b/guests/host_va= rs/libvirt-ubuntu-1804/main.yml index c9515b6..5a1ffcf 100644 --- a/guests/host_vars/libvirt-ubuntu-1804/main.yml +++ b/guests/host_vars/libvirt-ubuntu-1804/main.yml @@ -32,4 +32,5 @@ python: /usr/bin/python3 su: /bin/su sudoers: /etc/sudoers =20 +ansible_python_package: python3 ansible_python_interpreter: /usr/bin/python3 diff --git a/guests/playbooks/update/tasks/bootstrap.yml b/guests/playbooks= /update/tasks/bootstrap.yml index 2e1dc42..410fe66 100644 --- a/guests/playbooks/update/tasks/bootstrap.yml +++ b/guests/playbooks/update/tasks/bootstrap.yml @@ -4,14 +4,5 @@ when: - package_format =3D=3D 'pkg' =20 -- set_fact: - python: python3 - -- set_fact: - python: python2 - when: - - os_name =3D=3D 'CentOS' - - os_version =3D=3D '7' - - name: Bootstrap Ansible - raw: '{{ package_manager }} install -y {{ python }}' + raw: '{{ package_manager }} install -y {{ ansible_python_package }}' --=20 2.25.1