From nobody Sat May 4 12:52:24 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of redhat.com designates 205.139.110.61 as permitted sender) client-ip=205.139.110.61; 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 205.139.110.61 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=1588861054; cv=none; d=zohomail.com; s=zohoarc; b=NeTdTYaMrQgUzMLsqL80Z/dVqqq+m8k3ZhUCV/wCAGFKaPxJ4hnilSnrBm9ehlWDi4rTYgx4CPqqhhgd6n++uTZvIyGXQ86Eo8R6/agzvcqFx0HdUaTkTyLsZv/61IT11Z3N4XKfaaWyux6b1xvvj6rmF4WAnNU7pE+ntVhTpw8= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1588861054; 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=+I+r9DsFRoULOCsRSuZPPaePJxziQ4ZlL2UoUpxZJnY=; b=i8qnxWyc0Y8I3uefE/MitRcM6Cfm7hbm0SJ19bC1CK/+jfeEYbSQ4U3+vmbbhdzEh2r/en63XR4z8fecNc7Kw+NZH7iv7XreNRioRUbtXPUE4ZSmLTw3LqZHiae1ZZ7pVNwOFTu3vLmrIeQm/WbUwRD2XjqZyAUkxRYdiY92meU= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 205.139.110.61 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 [205.139.110.61]) by mx.zohomail.com with SMTPS id 1588861054161641.4628776389919; Thu, 7 May 2020 07:17:34 -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-126-FFWumUnzM-uX_vNAOM6-Hw-1; Thu, 07 May 2020 10:17:29 -0400 Received: from smtp.corp.redhat.com (int-mx05.intmail.prod.int.phx2.redhat.com [10.5.11.15]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id EC30318C35BC; Thu, 7 May 2020 14:17:21 +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 7ECF262A9E; Thu, 7 May 2020 14:17:20 +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 158354CAA7; Thu, 7 May 2020 14:17:17 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx06.intmail.prod.int.phx2.redhat.com [10.5.11.16]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id 047EHE0D027418 for ; Thu, 7 May 2020 10:17:14 -0400 Received: by smtp.corp.redhat.com (Postfix) id D05D85C1BE; Thu, 7 May 2020 14:17:14 +0000 (UTC) Received: from kinshicho.usersys.redhat.com (unknown [10.40.194.140]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 295875C1B0 for ; Thu, 7 May 2020 14:17:11 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1588861052; 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=+I+r9DsFRoULOCsRSuZPPaePJxziQ4ZlL2UoUpxZJnY=; b=HXtgM6A8MB0u4FeO1EKwnR4FNOSI2cftGpewUQQOmTqglFvX0ebUcDb1vBxZlIIHIHIpCO 7oJTgNOdfiGgLOH/vawhTj5RmSY2592bdc0GW5TlaLhxXMYfTGde0Z19SZfNDSyCup/y4M LTmRl1UkZCTKtiMkWnfCa/xO8T/0hSk= X-MC-Unique: FFWumUnzM-uX_vNAOM6-Hw-1 From: Andrea Bolognani To: libvir-list@redhat.com Subject: [libvirt-ci PATCH] lcitool: Make Python 3 only Date: Thu, 7 May 2020 16:17:08 +0200 Message-Id: <20200507141708.846568-1-abologna@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.16 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.15 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" All platforms we care about have Python 3 available. Signed-off-by: Andrea Bolognani Reviewed-by: Erik Skultety --- guests/lcitool | 11 +++-------- 1 file changed, 3 insertions(+), 8 deletions(-) diff --git a/guests/lcitool b/guests/lcitool index ab3b95f..a30187b 100755 --- a/guests/lcitool +++ b/guests/lcitool @@ -1,4 +1,4 @@ -#!/usr/bin/env python +#!/usr/bin/env python3 =20 # lcitool - libvirt CI guest management tool # Copyright (C) 2017-2018 Andrea Bolognani @@ -17,6 +17,7 @@ # with this program. If not, see . =20 import argparse +import configparser import distutils.spawn import fnmatch import json @@ -31,12 +32,6 @@ import tempfile import textwrap import yaml =20 -# This is necessary to maintain Python 2.7 compatibility -try: - from configparser import ConfigParser -except ImportError: - from ConfigParser import SafeConfigParser as ConfigParser - =20 class Util: =20 @@ -263,7 +258,7 @@ class Inventory: ansible_cfg_path =3D os.path.join(base, "ansible.cfg") =20 try: - parser =3D ConfigParser() + parser =3D configparser.ConfigParser() parser.read(ansible_cfg_path) inventory_path =3D parser.get("defaults", "inventory") except Exception as ex: --=20 2.25.4