From nobody Thu Apr 18 08:16:41 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of redhat.com designates 209.132.183.28 as permitted sender) client-ip=209.132.183.28; envelope-from=libvir-list-bounces@redhat.com; helo=mx1.redhat.com; Authentication-Results: mx.zohomail.com; spf=pass (zoho.com: domain of redhat.com designates 209.132.183.28 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=1556877777; cv=none; d=zoho.com; s=zohoarc; b=e7onUpFQBYDzHCS196rgMssSma0y8sXK7odeHEusJ8Lp/YXQktehL/dsfWggXNa5/nBkyVCahwaY2/21cL10g80hOOAnxEXJGXJO/9O04qKh133srIQe3W0H1jUYBPfmleCI433GFaJUM/CudGsD6S+XSU49ah9lRGBhxqYaoMM= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zoho.com; s=zohoarc; t=1556877777; 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:ARC-Authentication-Results; bh=RqCpPSW9lNsfQdUY0fEH+r+rLHbmJHbssbctk5oQhMQ=; b=U/2PQJLlZCN80YpJJIEWQ1tFFhi3L681kC74mLQWD+6y60BvjjLbLqPV79CsfBhMNq5qpaSe6EGUqeQKy3kEB5w69lmSOTeRapwCGd5mRdpUdPtqbufvDORtyIUPqNMPJnE8Me3fof87mpmFLd/u2fVBU8fhWlgyj8PaKAqiS/8= ARC-Authentication-Results: i=1; mx.zoho.com; spf=pass (zoho.com: domain of redhat.com designates 209.132.183.28 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=pass header.from= (p=none dis=none) header.from= Return-Path: Received: from mx1.redhat.com (mx1.redhat.com [209.132.183.28]) by mx.zohomail.com with SMTPS id 1556877777576712.9169823575324; Fri, 3 May 2019 03:02:57 -0700 (PDT) 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 mx1.redhat.com (Postfix) with ESMTPS id E9132883B8; Fri, 3 May 2019 10:02:55 +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 B2E9660BFB; Fri, 3 May 2019 10:02:55 +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 6E74A3FB13; Fri, 3 May 2019 10:02:55 +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 x43A2rm3015626 for ; Fri, 3 May 2019 06:02:53 -0400 Received: by smtp.corp.redhat.com (Postfix) id 844721001E8B; Fri, 3 May 2019 10:02:53 +0000 (UTC) Received: from localhost.localdomain.com (ovpn-112-52.ams2.redhat.com [10.36.112.52]) by smtp.corp.redhat.com (Postfix) with ESMTP id 459691001E87; Fri, 3 May 2019 10:02:49 +0000 (UTC) From: =?UTF-8?q?Daniel=20P=2E=20Berrang=C3=A9?= To: libvir-list@redhat.com Date: Fri, 3 May 2019 11:02:47 +0100 Message-Id: <20190503100247.20222-1-berrange@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.84 on 10.5.11.22 X-loop: libvir-list@redhat.com Subject: [libvirt] [jenkins-ci PATCH] lcitool: don't use SafeConfigParser under Python3 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: , Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable 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-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.26]); Fri, 03 May 2019 10:02:56 +0000 (UTC) Since Python 3.2 the SafeConfigParser class is renamed to just ConfigParser. The SafeConfigParser alias is targetted for deletion. ./lcitool:224: DeprecationWarning: The SafeConfigParser class has been renamed to ConfigParser in Python 3.2. This alias will be removed in future versions. Use ConfigParser directly instead. This switches to use ConfigParser all the time on Py3. Technically this is wrong on 3.0 and 3.1, but in reality no one will still be using those, only more modern 3.x versions, or the legacy 2.7. Signed-off-by: Daniel P. Berrang=C3=A9 Reviewed-by: Andrea Bolognani --- guests/lcitool | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/guests/lcitool b/guests/lcitool index d3937be..1c18b5a 100755 --- a/guests/lcitool +++ b/guests/lcitool @@ -31,9 +31,9 @@ import yaml =20 # This is necessary to maintain Python 2.7 compatibility try: - import configparser + from configparser import ConfigParser except ImportError: - import ConfigParser as configparser + from ConfigParser import SafeConfigParser as ConfigParser =20 =20 class Util: @@ -221,7 +221,7 @@ class Inventory: ansible_cfg_path =3D os.path.join(base, "ansible.cfg") =20 try: - parser =3D configparser.SafeConfigParser() + parser =3D ConfigParser() parser.read(ansible_cfg_path) inventory_path =3D parser.get("defaults", "inventory") except Exception as ex: --=20 2.21.0 -- libvir-list mailing list libvir-list@redhat.com https://www.redhat.com/mailman/listinfo/libvir-list