From nobody Sat Feb 7 08:45:09 2026 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of redhat.com designates 170.10.129.124 as permitted sender) client-ip=170.10.129.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 170.10.129.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=1685950863; cv=none; d=zohomail.com; s=zohoarc; b=BJb+rLUtJNmbTxRcJxH0OFlI4WNQSeWUgjE915DenpOdwfjkq23n9uGZiVLxwj/QyJ0SdjGvSnW5OCfngJZB7mG4QROvnb5kAzmQR6MZtZMqBtUwa8QVzBkGxoP5oylQAWfbg8N/bTjJnwDG6C+A0+b6ejRprGACQUOBLgo+XDs= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1685950863; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:Sender:Subject:To; bh=BOYgSmRMqJPvAgB2JtrbqQ3Gtdu8MeZQ491vh52f2l0=; b=FwbiE9YDQajKdqZluxfQsE5kvMFUIqJ+Q6Ro0ZIlzYClpdJ8tLWoY6J/EREEcUjsu5aGcRRtU/Z/rr52GvXgTSG33mko7tVGMH5YLpGA5ub76c8Mz0MkvlQcGK4tB95M2VC/zDXkExxQzwGbGAveNuKElopBI9Cj7keRPpp3ils= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 170.10.129.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 [170.10.129.124]) by mx.zohomail.com with SMTPS id 168595086394877.83780656161525; Mon, 5 Jun 2023 00:41:03 -0700 (PDT) Received: from mimecast-mx02.redhat.com (mimecast-mx02.redhat.com [66.187.233.88]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-610-eZr7E_cTPWuWDGJcfgzyIQ-1; Mon, 05 Jun 2023 03:40:38 -0400 Received: from smtp.corp.redhat.com (int-mx07.intmail.prod.int.rdu2.redhat.com [10.11.54.7]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id 7AF608039BE; Mon, 5 Jun 2023 07:40:36 +0000 (UTC) Received: from mm-prod-listman-01.mail-001.prod.us-east-1.aws.redhat.com (unknown [10.30.29.100]) by smtp.corp.redhat.com (Postfix) with ESMTP id B8A93140E954; Mon, 5 Jun 2023 07:40:34 +0000 (UTC) Received: from mm-prod-listman-01.mail-001.prod.us-east-1.aws.redhat.com (localhost [IPv6:::1]) by mm-prod-listman-01.mail-001.prod.us-east-1.aws.redhat.com (Postfix) with ESMTP id 9E84019465A0; Mon, 5 Jun 2023 07:40:34 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx03.intmail.prod.int.rdu2.redhat.com [10.11.54.3]) by mm-prod-listman-01.mail-001.prod.us-east-1.aws.redhat.com (Postfix) with ESMTP id B0AF51946595 for ; Mon, 5 Jun 2023 07:40:19 +0000 (UTC) Received: by smtp.corp.redhat.com (Postfix) id 147131121318; Mon, 5 Jun 2023 07:40:19 +0000 (UTC) Received: from localhost.localdomain (ovpn-12-23.pek2.redhat.com [10.72.12.23]) by smtp.corp.redhat.com (Postfix) with ESMTP id 9DA8B1121314; Mon, 5 Jun 2023 07:40:17 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1685950862; h=from:from:sender:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc: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=BOYgSmRMqJPvAgB2JtrbqQ3Gtdu8MeZQ491vh52f2l0=; b=V7Lzp6z2E8uLoYqqL+lRWdmL6Sj2Rw8kNkHqJ8/UcXy6IZZpHhuOjFMyKi5qrQIzEb9crT jceMs4aH023kG9nVYtbspyTLUU040bjOzSeI4rwH7ryYdlaRbAv8UUtOniEDBczvVVhHe6 xCjbslcbutIBI2b/q9MLUI+1sLWT8zk= X-MC-Unique: eZr7E_cTPWuWDGJcfgzyIQ-1 X-Original-To: libvir-list@listman.corp.redhat.com From: Han Han To: libvir-list@redhat.com Subject: [PATCH] scripts: Fix the flake8 syntax-check failures Date: Mon, 5 Jun 2023 15:40:13 +0800 Message-Id: <20230605074013.1252022-1-hhan@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 3.1 on 10.11.54.3 X-BeenThere: libvir-list@redhat.com X-Mailman-Version: 2.1.29 Precedence: list List-Id: Development discussions about the libvirt library & tools List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Han Han Errors-To: libvir-list-bounces@redhat.com Sender: "libvir-list" X-Scanned-By: MIMEDefang 3.1 on 10.11.54.7 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: 1685950865072100001 Content-Type: text/plain; charset="utf-8"; x-default="true" Fix the syntax-check failures with the help of isort[1]: 289/316 libvirt:syntax-check / flake8 FAIL 5.24s exit status 2 [1]: https://pycqa.github.io/isort/ Signed-off-by: Han Han Reviewed-by: Michal Privoznik --- ci/util.py | 3 +-- run.in | 2 +- scripts/apibuild.py | 6 +++--- scripts/check-html-references.py | 4 ++-- scripts/check-pot.py | 2 +- scripts/esx_vi_generator.py | 3 +-- scripts/hvsupport.py | 2 +- scripts/hyperv_wmi_generator.py | 2 +- scripts/meson-timestamp.py | 1 - src/cpu_map/sync_qemu_models_i386.py | 3 ++- tests/cputestdata/cpu-data.py | 1 - tests/virsh-auth | 2 +- tools/virt-qemu-qmp-proxy | 9 +++++---- tools/virt-qemu-sev-validate | 9 +++++---- 14 files changed, 24 insertions(+), 25 deletions(-) diff --git a/ci/util.py b/ci/util.py index f9f3c550db..f18da8d662 100644 --- a/ci/util.py +++ b/ci/util.py @@ -1,8 +1,7 @@ import json import pathlib -import urllib.request import urllib.parse - +import urllib.request from typing import Dict, List =20 =20 diff --git a/run.in b/run.in index c6d3411082..80a5d2dd43 100644 --- a/run.in +++ b/run.in @@ -44,8 +44,8 @@ import os import os.path import random import signal -import sys import subprocess +import sys =20 =20 # Function to intelligently prepend a path to an environment variable. diff --git a/scripts/apibuild.py b/scripts/apibuild.py index f532dbe834..3ecc3eadf7 100755 --- a/scripts/apibuild.py +++ b/scripts/apibuild.py @@ -8,11 +8,11 @@ # daniel@veillard.com # =20 -import os -import sys +import argparse import glob +import os import re -import argparse +import sys =20 quiet =3D True warnings =3D 0 diff --git a/scripts/check-html-references.py b/scripts/check-html-referenc= es.py index 788622a2d0..d15f28bea7 100755 --- a/scripts/check-html-references.py +++ b/scripts/check-html-references.py @@ -16,10 +16,10 @@ # # Check that external references between documentation HTML files are not = broken. =20 -import sys -import os import argparse +import os import re +import sys import xml.etree.ElementTree as ET =20 ns =3D {'html': 'http://www.w3.org/1999/xhtml'} diff --git a/scripts/check-pot.py b/scripts/check-pot.py index f6b4fbf36d..6b6b1879fa 100755 --- a/scripts/check-pot.py +++ b/scripts/check-pot.py @@ -1,7 +1,7 @@ #!/usr/bin/env python3 =20 -import sys import re +import sys =20 if len(sys.argv) !=3D 2: print(f"usage: {sys.argv[0]} POTFILE", file=3Dsys.stderr) diff --git a/scripts/esx_vi_generator.py b/scripts/esx_vi_generator.py index 31c36f42e2..0e9adeeefd 100755 --- a/scripts/esx_vi_generator.py +++ b/scripts/esx_vi_generator.py @@ -22,10 +22,9 @@ # . # =20 -import sys import os import os.path - +import sys =20 OCCURRENCE__REQUIRED_ITEM =3D "r" OCCURRENCE__REQUIRED_LIST =3D "rl" diff --git a/scripts/hvsupport.py b/scripts/hvsupport.py index be6bf7b0d2..2327bdf3b8 100755 --- a/scripts/hvsupport.py +++ b/scripts/hvsupport.py @@ -16,9 +16,9 @@ # License along with this library. If not, see # . =20 -import sys import os.path import re +import sys =20 if len(sys.argv) !=3D 3: print("syntax: %s TOP-SRCDIR TOP-BUILDDIR\n" % sys.argv[0], file=3Dsys= .stderr) diff --git a/scripts/hyperv_wmi_generator.py b/scripts/hyperv_wmi_generator= .py index d11dfb1809..e10f7f79a7 100755 --- a/scripts/hyperv_wmi_generator.py +++ b/scripts/hyperv_wmi_generator.py @@ -20,9 +20,9 @@ # . # =20 -import sys import os import os.path +import sys =20 separator =3D "/*" + ("*" * 50) + "*\n" wmi_classes_by_name =3D {} diff --git a/scripts/meson-timestamp.py b/scripts/meson-timestamp.py index f109cad66e..01dc794a5a 100755 --- a/scripts/meson-timestamp.py +++ b/scripts/meson-timestamp.py @@ -1,7 +1,6 @@ #!/usr/bin/env python3 =20 import os - from datetime import datetime, timezone =20 timestamp =3D os.environ.get('SOURCE_DATE_EPOCH', None) diff --git a/src/cpu_map/sync_qemu_models_i386.py b/src/cpu_map/sync_qemu_m= odels_i386.py index b5e738def7..65181b6f90 100755 --- a/src/cpu_map/sync_qemu_models_i386.py +++ b/src/cpu_map/sync_qemu_models_i386.py @@ -2,11 +2,12 @@ =20 import argparse import copy -import lark import os import re import xml.etree.ElementTree =20 +import lark + =20 def translate_vendor(name): T =3D { diff --git a/tests/cputestdata/cpu-data.py b/tests/cputestdata/cpu-data.py index b5641f7c16..37fb2e3791 100755 --- a/tests/cputestdata/cpu-data.py +++ b/tests/cputestdata/cpu-data.py @@ -10,7 +10,6 @@ import subprocess import sys import xml.etree.ElementTree =20 - _KEYS =3D { "cpuid": ["eax_in", "ecx_in"], "msr": ["index"], diff --git a/tests/virsh-auth b/tests/virsh-auth index ce3a599107..f4ed798ec4 100755 --- a/tests/virsh-auth +++ b/tests/virsh-auth @@ -19,8 +19,8 @@ =20 import os import os.path -import sys import subprocess +import sys =20 builddir =3D os.getenv("abs_top_builddir") if builddir is None: diff --git a/tools/virt-qemu-qmp-proxy b/tools/virt-qemu-qmp-proxy index dfbaa1ff0c..dcdb24b9a9 100755 --- a/tools/virt-qemu-qmp-proxy +++ b/tools/virt-qemu-qmp-proxy @@ -2,16 +2,17 @@ =20 import argparse import array -import libvirt -import libvirt_qemu +import fcntl +import json import os import re import socket import sys import traceback -import json -import fcntl =20 +import libvirt + +import libvirt_qemu =20 debug =3D False =20 diff --git a/tools/virt-qemu-sev-validate b/tools/virt-qemu-sev-validate index 7a8c3205e7..209f19a4a8 100755 --- a/tools/virt-qemu-sev-validate +++ b/tools/virt-qemu-sev-validate @@ -36,22 +36,23 @@ =20 import abc import argparse -from base64 import b64decode, b64encode -from hashlib import sha256 import hmac import logging import os import re import socket -from struct import pack import sys import traceback +from base64 import b64decode, b64encode +from hashlib import sha256 +from struct import pack from uuid import UUID + from cryptography.hazmat.primitives.ciphers import Cipher, algorithms, mod= es =20 +import libvirt =20 from lxml import etree -import libvirt =20 log =3D logging.getLogger() =20 --=20 2.40.1