From nobody Mon Apr 29 13:36:17 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=1576156980; cv=none; d=zohomail.com; s=zohoarc; b=ngAICAKzXXEJ6B9eT+lH8fWTECtpSoRtlzx0a4ipoVwLYy8DBMNrLFPD36okyhNZsin3BuS4zWM9j6G3s1LN5w3B8jp2KLBeMM9oOJCFTDV/XkJ9tAs9XZsUTypdnxSNvTsFAgmoIHXyGUrZYmDeDkE+0Z/hs99+S+NJfMYqUZM= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1576156980; h=Content-Type:Content-Transfer-Encoding:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=cYejODNYThIRFex/KjRuFHNmvErhoJn0mbTXaK13N7k=; b=LNz4M5gt6eHjM9CM1PNfhRFkdUsDIqaIZgKKGQpJPZQ7ogNVS68129bMNxqu3XAwlDin4SoUCoUeo4D5KxD9NQmHct5p5XW2OIANhsXn+Qp32QLGxn0ltrM0gLG4sDH9UZ/ZnXloHkRTr5vgifGX12DfPlS4BS53PxMPCyX38q0= 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-2.mimecast.com [207.211.31.81]) by mx.zohomail.com with SMTPS id 1576156980838113.6837635395716; Thu, 12 Dec 2019 05:23:00 -0800 (PST) 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-377-C_SKwffSPsq5nH7smCy3iQ-1; Thu, 12 Dec 2019 08:22:58 -0500 Received: from smtp.corp.redhat.com (int-mx04.intmail.prod.int.phx2.redhat.com [10.5.11.14]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 78EAD801E78; Thu, 12 Dec 2019 13:22:52 +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 4E1E35D9E2; Thu, 12 Dec 2019 13:22:52 +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 026AD18034EC; Thu, 12 Dec 2019 13:22:52 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx02.intmail.prod.int.phx2.redhat.com [10.5.11.12]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id xBCDMZf2020811 for ; Thu, 12 Dec 2019 08:22:35 -0500 Received: by smtp.corp.redhat.com (Postfix) id BFCAF60C05; Thu, 12 Dec 2019 13:22:35 +0000 (UTC) Received: from kinshicho.usersys.redhat.com (ovpn-204-156.brq.redhat.com [10.40.204.156]) by smtp.corp.redhat.com (Postfix) with ESMTPS id D027460BF3 for ; Thu, 12 Dec 2019 13:22:34 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1576156979; 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: in-reply-to:in-reply-to:references:references:list-id:list-help: list-unsubscribe:list-subscribe:list-post; bh=cYejODNYThIRFex/KjRuFHNmvErhoJn0mbTXaK13N7k=; b=W01M7kt7RDly+JLcyG4JSwHZ2QcIgSSV4SXnRoZSnY8qpEwQDHqUo9eTus5tOrxDjugg7e yXZcKNS68ISDx42xMJaPhVFMI8TM9BY1tgmsB6G6VCpcnME/sF2MsPrDtIW7sbsyB+ynXS 5mkzXiG0T32EzpCuYBG0yjTYq6hGsPk= From: Andrea Bolognani To: libvir-list@redhat.com Date: Thu, 12 Dec 2019 14:22:26 +0100 Message-Id: <20191212132227.454094-2-abologna@redhat.com> In-Reply-To: <20191212132227.454094-1-abologna@redhat.com> References: <20191212132227.454094-1-abologna@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.12 X-loop: libvir-list@redhat.com Subject: [libvirt] [jenkins-ci PATCH 1/2] lcitool: Perform system update after enabling repos 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.14 X-MC-Unique: C_SKwffSPsq5nH7smCy3iQ-1 X-Mimecast-Spam-Score: 0 Content-Transfer-Encoding: quoted-printable X-ZohoMail-DKIM: pass (identity @redhat.com) Content-Type: text/plain; charset="utf-8" Both orders work and lead to the same results, but performing the steps in this specific order will make further refactoring easier. Signed-off-by: Andrea Bolognani Reviewed-by: Fabiano Fid=C3=AAncio --- guests/lcitool | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/guests/lcitool b/guests/lcitool index d4dc1c8..4c2a04e 100755 --- a/guests/lcitool +++ b/guests/lcitool @@ -751,18 +751,18 @@ class Application: elif os_name =3D=3D "CentOS": if os_version =3D=3D "7": sys.stdout.write(textwrap.dedent(""" - RUN {package_manager} update -y && \\ - {package_manager} install -y epel-release && \\ + RUN {package_manager} install -y epel-release && \\ + {package_manager} update -y && \\ {package_manager} install -y {pkgs} && \\ {package_manager} autoremove -y && \\ {package_manager} clean all -y """).format(**varmap)) else: sys.stdout.write(textwrap.dedent(""" - RUN {package_manager} update -y && \\ - {package_manager} install 'dnf-command(config-= manager)' -y && \\ + RUN {package_manager} install 'dnf-command(config-= manager)' -y && \\ {package_manager} config-manager --set-enabled= PowerTools -y && \\ {package_manager} install -y epel-release && \\ + {package_manager} update -y && \\ {package_manager} install -y {pkgs} && \\ {package_manager} autoremove -y && \\ {package_manager} clean all -y --=20 2.23.0 -- libvir-list mailing list libvir-list@redhat.com https://www.redhat.com/mailman/listinfo/libvir-list From nobody Mon Apr 29 13:36:17 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of redhat.com designates 207.211.31.120 as permitted sender) client-ip=207.211.31.120; envelope-from=libvir-list-bounces@redhat.com; helo=us-smtp-1.mimecast.com; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 207.211.31.120 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=1576156969; cv=none; d=zohomail.com; s=zohoarc; b=SRb44Hc6zbgRsKfQO7UHJiLwJZ2MGZs93DcTjtHg3FdJ293xTNplkXxriC1nTddiUW7R4IOWNynK4d6y/JvQGbBPTrPe4WPrCIjvLSkomqXLSzB1muMbKdexLa6lrBg4dIMoX57Z4II90EiYWKLY48XozERiAhWuZYIwRzVdh1s= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1576156969; h=Content-Type:Content-Transfer-Encoding:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=v5wLj5pjtows7jeU4iw275a2k2NFijwLzk5MhKvSg/8=; b=MFBRY0Pjn8GYUJN3Pb8tnIf9q/h1UcUNftcm/cVqrg8Ecm06t0ES52gE1Ag6x3OngxKiShPJ2wuUeoQbhCdAQWRF9QBLIuTXBVRPEo9mFTawLUu1p/nmtgaScWiZonTu0lCTzqnPuRKFoijlbaRfvaTgzQaqGwEF6WVeD/rYGkE= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 207.211.31.120 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-1.mimecast.com (us-smtp-delivery-1.mimecast.com [207.211.31.120]) by mx.zohomail.com with SMTPS id 1576156969832939.1328232416064; Thu, 12 Dec 2019 05:22:49 -0800 (PST) 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-325-bA14z3bPOBy6VFLyXew7GA-1; Thu, 12 Dec 2019 08:22:46 -0500 Received: from smtp.corp.redhat.com (int-mx02.intmail.prod.int.phx2.redhat.com [10.5.11.12]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id E50151852E2A; Thu, 12 Dec 2019 13:22:40 +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 3A0D260BF1; Thu, 12 Dec 2019 13:22:40 +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 C622218034E9; Thu, 12 Dec 2019 13:22:37 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx02.intmail.prod.int.phx2.redhat.com [10.5.11.12]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id xBCDMa5k020837 for ; Thu, 12 Dec 2019 08:22:36 -0500 Received: by smtp.corp.redhat.com (Postfix) id E653160C05; Thu, 12 Dec 2019 13:22:36 +0000 (UTC) Received: from kinshicho.usersys.redhat.com (ovpn-204-156.brq.redhat.com [10.40.204.156]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 2CC2760BF3 for ; Thu, 12 Dec 2019 13:22:35 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1576156968; 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: in-reply-to:in-reply-to:references:references:list-id:list-help: list-unsubscribe:list-subscribe:list-post; bh=v5wLj5pjtows7jeU4iw275a2k2NFijwLzk5MhKvSg/8=; b=icGwst6YwSRVCQEHY/CLDfZ5qNLobCcmfDbdAMtj+QBL1cn/4H2TU+z9p1WqFC7WtTPpGP tRHIquYoKZMKlXJT8OylqMMmjIJym1pRQZpDsXnBTtiDfGfLK5PIIJAr7K7jQHv9ysbJeY GkWvHvOzvolyElzJRVgCNVTIWfkj4W8= From: Andrea Bolognani To: libvir-list@redhat.com Date: Thu, 12 Dec 2019 14:22:27 +0100 Message-Id: <20191212132227.454094-3-abologna@redhat.com> In-Reply-To: <20191212132227.454094-1-abologna@redhat.com> References: <20191212132227.454094-1-abologna@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.12 X-loop: libvir-list@redhat.com Subject: [libvirt] [jenkins-ci PATCH 2/2] lcitool: Refactor Dockerfile generation 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.12 X-MC-Unique: bA14z3bPOBy6VFLyXew7GA-1 X-Mimecast-Spam-Score: 0 Content-Transfer-Encoding: quoted-printable X-ZohoMail-DKIM: pass (identity @redhat.com) Content-Type: text/plain; charset="utf-8" The current code is quite a mess, with the same commands being repeated over and over again with very minor variations based on necessities that are not spelled out at all. Refactor it and solve both issues in the process; the output is entirely unchanged. Signed-off-by: Andrea Bolognani Reviewed-by: Fabiano Fid=C3=AAncio --- guests/lcitool | 66 +++++++++++++++++++++++++------------------------- 1 file changed, 33 insertions(+), 33 deletions(-) diff --git a/guests/lcitool b/guests/lcitool index 4c2a04e..9958508 100755 --- a/guests/lcitool +++ b/guests/lcitool @@ -740,40 +740,40 @@ class Application: {package_manager} autoclean -y """).format(**varmap)) elif package_format =3D=3D "rpm": + commands =3D [] + + # Rawhide needs this because the keys used to sign packages are + # cycled from time to time if os_name =3D=3D "Fedora" and os_version =3D=3D "Rawhide": - sys.stdout.write(textwrap.dedent(""" - RUN {package_manager} update -y --nogpgcheck fedora-gp= g-keys && \\ - {package_manager} update -y && \\ - {package_manager} install -y {pkgs} && \\ - {package_manager} autoremove -y && \\ - {package_manager} clean all -y - """).format(**varmap)) - elif os_name =3D=3D "CentOS": - if os_version =3D=3D "7": - sys.stdout.write(textwrap.dedent(""" - RUN {package_manager} install -y epel-release && \\ - {package_manager} update -y && \\ - {package_manager} install -y {pkgs} && \\ - {package_manager} autoremove -y && \\ - {package_manager} clean all -y - """).format(**varmap)) - else: - sys.stdout.write(textwrap.dedent(""" - RUN {package_manager} install 'dnf-command(config-= manager)' -y && \\ - {package_manager} config-manager --set-enabled= PowerTools -y && \\ - {package_manager} install -y epel-release && \\ - {package_manager} update -y && \\ - {package_manager} install -y {pkgs} && \\ - {package_manager} autoremove -y && \\ - {package_manager} clean all -y - """).format(**varmap)) - else: - sys.stdout.write(textwrap.dedent(""" - RUN {package_manager} update -y && \\ - {package_manager} install -y {pkgs} && \\ - {package_manager} autoremove -y && \\ - {package_manager} clean all -y - """).format(**varmap)) + commands.extend([ + "{package_manager} update -y --nogpgcheck fedora-gpg-k= eys" + ]) + + if os_name =3D=3D "CentOS": + # Starting with CentOS 8, most -devel packages are shipped= in + # the PowerTools repository, which is not enabled by defau= lt + if os_version !=3D "7": + commands.extend([ + "{package_manager} install 'dnf-command(config-man= ager)' -y", + "{package_manager} config-manager --set-enabled Po= werTools -y", + ]) + + # Some of the packages we need are not part of CentOS prop= er + # and are only available through EPEL + commands.extend([ + "{package_manager} install -y epel-release", + ]) + + commands.extend([ + "{package_manager} update -y", + "{package_manager} install -y {pkgs}", + "{package_manager} autoremove -y", + "{package_manager} clean all -y", + ]) + + script =3D "\nRUN " + (" && \\\n ".join(commands)) + "\n" + + sys.stdout.write(script.format(**varmap)) =20 if pip_pkgs: sys.stdout.write(textwrap.dedent(""" --=20 2.23.0 -- libvir-list mailing list libvir-list@redhat.com https://www.redhat.com/mailman/listinfo/libvir-list