From nobody Mon Feb 9 08:28:32 2026 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=1631282689; cv=none; d=zohomail.com; s=zohoarc; b=KgHlCZ5fOBDnP0pS5wOB5KeVWStYYiKWSDdjpE+AbjQ1syLYRUCoaxLwCsIagORNcLl+Re9ixDGvRbr6BNfvp+42vajFaecdzSmNLcUevQAd32cDQsko27UNvnqmkQ1cSQ0u/q1tTNra9UV/yp0/pDeBC9ry/JtU0315RX87mMU= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1631282689; 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=HdLccw1LQdmsNNhXsQd0e3ic+6mYuPG3LfMMQkTG1Yw=; b=D0poTjfy4CnG3k6o1MDZ+A4K6lMU3aCByM1ZBOh0qR8XJDwNislgbqKkhJQiAiM6t+2ilCrUpIwyoOIm5wwOYiYmqgCDW2ONOoyYQFN5HICAQxsqlBahK8rMO5qqDII9dz1YFWIoPtWyKdYssO774QqZNcwvOdj18zw8YbJWMsA= 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 1631282689471479.840458365623; Fri, 10 Sep 2021 07:04:49 -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-305-hNfaAk6dMX6TbstC_9m2jw-1; Fri, 10 Sep 2021 10:04:40 -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 CB71E50751; Fri, 10 Sep 2021 14:04:34 +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 AFA4B1981F; Fri, 10 Sep 2021 14:04:34 +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 287F84EA37; Fri, 10 Sep 2021 14:04:34 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx07.intmail.prod.int.phx2.redhat.com [10.5.11.22]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id 18ADxxVf025719 for ; Fri, 10 Sep 2021 09:59:59 -0400 Received: by smtp.corp.redhat.com (Postfix) id DC98610016FE; Fri, 10 Sep 2021 13:59:59 +0000 (UTC) Received: from harajuku.usersys.redhat.com.homenet.telecomitalia.it (unknown [10.40.193.145]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 4B39B10074E5 for ; Fri, 10 Sep 2021 13:59:59 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1631282687; 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=HdLccw1LQdmsNNhXsQd0e3ic+6mYuPG3LfMMQkTG1Yw=; b=MSJLr0xLcbZxWAbv26WAf2CvqzMj425Woqur+fYh5l1iDGCNlXthFyH05/UmNORvP/7Lr+ f6LrhjqYLGRItTar3a3L+fwwebjvqEiOSlbF8Qnt4qB2jZLG7WBPXWDOxHutebWEAzd7RG /9NGrj6H2op2vXMWeOAUw8+E+Tcgu18= X-MC-Unique: hNfaAk6dMX6TbstC_9m2jw-1 From: Andrea Bolognani To: libvir-list@redhat.com Subject: [libvirt PATCH 2/2] ci: Avoid use of magic constants Date: Fri, 10 Sep 2021 15:59:55 +0200 Message-Id: <20210910135955.62046-3-abologna@redhat.com> In-Reply-To: <20210910135955.62046-1-abologna@redhat.com> References: <20210910135955.62046-1-abologna@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.84 on 10.5.11.22 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: 1631282690127100001 Content-Type: text/plain; charset="utf-8" The value 3 is the length of the "ci-" prefix, which is present in the items returned by get_registry_images() but not in those returned by get_dockerfiles(). Signed-off-by: Andrea Bolognani Reviewed-by: Beraldo Leal --- ci/util.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/ci/util.py b/ci/util.py index d8be6631eb..f9f3c550db 100644 --- a/ci/util.py +++ b/ci/util.py @@ -68,10 +68,11 @@ def get_registry_stale_images(registry_uri: str, base_d= ir: str) -> Dict[str, int =20 dockerfiles =3D get_dockerfiles(base_dir) images =3D get_registry_images(registry_uri) + name_prefix =3D "ci-" =20 stale_images =3D {} for img in images: - if img["name"][3:] not in dockerfiles: + if img["name"][len(name_prefix):] not in dockerfiles: stale_images[img["name"]] =3D img["id"] =20 return stale_images --=20 2.31.1