From nobody Tue Apr 30 12:00:27 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of redhat.com designates 216.205.24.124 as permitted sender) client-ip=216.205.24.124; envelope-from=libvir-list-bounces@redhat.com; helo=us-smtp-delivery-124.mimecast.com; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 216.205.24.124 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=1626962495; cv=none; d=zohomail.com; s=zohoarc; b=F6Ywta0mFMo0jVUgkcj2+XPb7AEmW0EotrLXdPetKuMvzAigEinjOrKA/nnTYbcLGGey4+Bus6Tx4X+/zwMvrsiTDsXPn9b8nlZ0C/eV34lvjLUO3BSgYOZgsgOU2t8bSrKhtA275Rec1PjNTYBeHeifvV3lBvP8kEv/hlZCMfA= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1626962495; 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=90tjGGO7ToeJv5rWJQgsTv1/z8NW5hRBBiL2kp7Xrlw=; b=lY68RrnFYn9juYzJC7zWPH9Iy9sfwWoZq+9gijinF6JzhqRe7DFiKrT3CjlJpilC0vbSTRThi8Sz8mNxm1pLsV1LfDAkYUNQ2qpc/o6SYZt/6xUr7PKotoyT1JRE9UPO/sQ5RvhX8R+JbnIuydFMGEmzGXTXEudNzaUzFfWozGM= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 216.205.24.124 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=pass header.from= (p=none dis=none) Return-Path: Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [216.205.24.124]) by mx.zohomail.com with SMTPS id 162696249500162.06004759517987; Thu, 22 Jul 2021 07:01:35 -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-47-MydWbA4EN_SDyC43mXPq3Q-1; Thu, 22 Jul 2021 10:01:32 -0400 Received: from smtp.corp.redhat.com (int-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.11]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 110C5760D4; Thu, 22 Jul 2021 14:01:26 +0000 (UTC) Received: from colo-mx.corp.redhat.com (colo-mx02.intmail.prod.int.phx2.redhat.com [10.5.11.21]) by smtp.corp.redhat.com (Postfix) with ESMTPS id AA3F1421F; Thu, 22 Jul 2021 14:01:24 +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 92DC04BB7C; Thu, 22 Jul 2021 14:01:20 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx03.intmail.prod.int.phx2.redhat.com [10.5.11.13]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id 16ME1JJg011129 for ; Thu, 22 Jul 2021 10:01:19 -0400 Received: by smtp.corp.redhat.com (Postfix) id A494760939; Thu, 22 Jul 2021 14:01:19 +0000 (UTC) Received: from harajuku.usersys.redhat.com.homenet.telecomitalia.it (unknown [10.40.192.52]) by smtp.corp.redhat.com (Postfix) with ESMTPS id E6A6B60C9B for ; Thu, 22 Jul 2021 14:01:16 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1626962494; 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=90tjGGO7ToeJv5rWJQgsTv1/z8NW5hRBBiL2kp7Xrlw=; b=e63ICRuiQfyvSoUvBd/T2IHloWMY7l/kHYSN8G81P4UXL62f7ZX4GT5i9lU4WrRt1iccCv /cosFLMyCw395no+DtWtunX2Y/NvPpSsKvYIPjU6B2sDemo+Hx7o4KMo4WI0xQCvxb68iF QM2w/KHvqmiUxs+tFtOTkrirql6xkFo= X-MC-Unique: MydWbA4EN_SDyC43mXPq3Q-1 From: Andrea Bolognani To: libvir-list@redhat.com Subject: [libvirt PATCH] ci: Adapt to lcitool command line changes Date: Thu, 22 Jul 2021 16:01:13 +0200 Message-Id: <20210722140113.10424-1-abologna@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.13 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.11 Authentication-Results: relay.mimecast.com; auth=pass smtp.auth=CUSA124A263 smtp.mailfrom=libvir-list-bounces@redhat.com X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Transfer-Encoding: quoted-printable X-ZohoMail-DKIM: pass (identity @redhat.com) X-ZM-MESSAGEID: 1626962512242100001 Content-Type: text/plain; charset="utf-8" lcitool now uses the term "target" instead of "host" to refer to the various operating systems it supports, and we need to adapt our helper script so that it works with the new command line interface. Signed-off-by: Andrea Bolognani Reviewed-by: Erik Skultety --- Getting this ready for when https://gitlab.com/libvirt/libvirt-ci/-/merge_requests/92 is merged. ci/helper | 44 ++++++++++++++++++++++---------------------- 1 file changed, 22 insertions(+), 22 deletions(-) diff --git a/ci/helper b/ci/helper index 2c3a9f8db4..441258f511 100755 --- a/ci/helper +++ b/ci/helper @@ -190,18 +190,18 @@ class Application: output =3D subprocess.check_output([self._args.lcitool] + args) return output.decode("utf-8") =20 - def _lcitool_get_hosts(self): - output =3D self._lcitool_run(["hosts"]) + def _lcitool_get_targets(self): + output =3D self._lcitool_run(["targets"]) return output.splitlines() =20 - def _generate_dockerfile(self, host, cross=3DNone): - args =3D ["dockerfile", host, "libvirt"] + def _generate_dockerfile(self, target, cross=3DNone): + args =3D ["dockerfile", target, "libvirt"] outdir =3D self._basedir.joinpath("containers") - outfile =3D f"{host}.Dockerfile" + outfile =3D f"{target}.Dockerfile" =20 if cross: args.extend(["--cross", cross]) - outfile =3D f"{host}-cross-{cross}.Dockerfile" + outfile =3D f"{target}-cross-{cross}.Dockerfile" =20 outpath =3D outdir.joinpath(outfile) if not self._args.quiet: @@ -211,10 +211,10 @@ class Application: with open(outpath, "w") as f: f.write(output) =20 - def _generate_vars(self, host): - args =3D ["variables", host, "libvirt"] + def _generate_vars(self, target): + args =3D ["variables", target, "libvirt"] outdir =3D self._basedir.joinpath("cirrus") - outfile =3D f"{host}.vars" + outfile =3D f"{target}.vars" =20 outpath =3D outdir.joinpath(outfile) if not self._args.quiet: @@ -241,37 +241,37 @@ class Application: "mingw64", ] =20 - for host in self._lcitool_get_hosts(): - if host.startswith("freebsd-") or host.startswith("macos-"): + for target in self._lcitool_get_targets(): + if target.startswith("freebsd-") or target.startswith("macos-"= ): continue =20 - self._generate_dockerfile(host) + self._generate_dockerfile(target) =20 - if host =3D=3D "fedora-rawhide": + if target =3D=3D "fedora-rawhide": for cross in fedora_cross: - self._generate_dockerfile(host, cross) + self._generate_dockerfile(target, cross) =20 - if host.startswith("debian-"): + if target.startswith("debian-"): for cross in debian_cross: - if host =3D=3D "debian-sid" and cross =3D=3D "mips": + if target =3D=3D "debian-sid" and cross =3D=3D "mips": continue - self._generate_dockerfile(host, cross) + self._generate_dockerfile(target, cross) =20 def _refresh_cirrus(self): - for host in self._lcitool_get_hosts(): - if not (host.startswith("freebsd-") or host.startswith("macos-= ")): + for target in self._lcitool_get_targets(): + if not (target.startswith("freebsd-") or target.startswith("ma= cos-")): continue =20 - self._generate_vars(host) + self._generate_vars(target) =20 def _check_stale_images(self): namespace =3D self._args.namespace gitlab_uri =3D self._args.gitlab_uri registry_uri =3D util.get_registry_uri(namespace, gitlab_uri) - lcitool_hosts =3D self._lcitool_get_hosts() + lcitool_targets =3D self._lcitool_get_targets() =20 stale_images =3D util.get_registry_stale_images(registry_uri, - lcitool_hosts) + lcitool_targets) if stale_images: spacing =3D "\n" + 4 * " " stale_fmt =3D [f"{k} (ID: {v})" for k, v in stale_images.items= ()] --=20 2.31.1