]> git.ipfire.org Git - thirdparty/libvirt.git/commitdiff
scripts: Fix the flake8 syntax-check failures
authorHan Han <hhan@redhat.com>
Mon, 5 Jun 2023 07:40:13 +0000 (15:40 +0800)
committerMichal Privoznik <mprivozn@redhat.com>
Thu, 29 Jun 2023 09:51:27 +0000 (11:51 +0200)
Fix the syntax-check failures (which can be seen after
python3-flake8-import-order package is installed) 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 <hhan@redhat.com>
Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
15 files changed:
ci/util.py
run.in
scripts/apibuild.py
scripts/check-html-references.py
scripts/check-pot.py
scripts/esx_vi_generator.py
scripts/hvsupport.py
scripts/hyperv_wmi_generator.py
scripts/meson-dist.py
scripts/meson-timestamp.py
src/cpu_map/sync_qemu_models_i386.py
tests/cputestdata/cpu-data.py
tests/virsh-auth
tools/virt-qemu-qmp-proxy
tools/virt-qemu-sev-validate

index f9f3c550db6c3722dab751087467301816ad1639..f18da8d662f74e395ea8531c16ca5228b8bc7fc3 100644 (file)
@@ -1,8 +1,7 @@
 import json
 import pathlib
-import urllib.request
 import urllib.parse
-
+import urllib.request
 from typing import Dict, List
 
 
diff --git a/run.in b/run.in
index c6d34110826f4132aa3f8bf725bb854d029faa01..80a5d2dd43fbb194c49ff992ea964bcfca6a3210 100644 (file)
--- 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
 
 
 # Function to intelligently prepend a path to an environment variable.
index f532dbe8340e39ab0906ddf469edec922a18c8c3..3ecc3eadf7b2d02ce9ad6ac43f00b6125cd86d56 100755 (executable)
@@ -8,11 +8,11 @@
 # daniel@veillard.com
 #
 
-import os
-import sys
+import argparse
 import glob
+import os
 import re
-import argparse
+import sys
 
 quiet = True
 warnings = 0
index 788622a2d08bfce0b980b8f95c20fe35e65b0458..d15f28bea759ba09ba65596a2e20fc01cf8a2ae1 100755 (executable)
 #
 # Check that external references between documentation HTML files are not broken.
 
-import sys
-import os
 import argparse
+import os
 import re
+import sys
 import xml.etree.ElementTree as ET
 
 ns = {'html': 'http://www.w3.org/1999/xhtml'}
index f6b4fbf36db399ef60eca565e388d48aa39197e1..6b6b1879fa751f2aa0374073b4989d4e5143a9a6 100755 (executable)
@@ -1,7 +1,7 @@
 #!/usr/bin/env python3
 
-import sys
 import re
+import sys
 
 if len(sys.argv) != 2:
     print(f"usage: {sys.argv[0]} POTFILE", file=sys.stderr)
index 31c36f42e2b6b73279261593892db29915636363..0e9adeeefddfccc8e70ea3b3fbd604727b6f58e7 100755 (executable)
 # <http://www.gnu.org/licenses/>.
 #
 
-import sys
 import os
 import os.path
-
+import sys
 
 OCCURRENCE__REQUIRED_ITEM = "r"
 OCCURRENCE__REQUIRED_LIST = "rl"
index be6bf7b0d2d9f879c3d649f178e8001ae1ef3cbd..2327bdf3b809f95a7fc78b54d9e085c6a95c726a 100755 (executable)
@@ -16,9 +16,9 @@
 # License along with this library.  If not, see
 # <http://www.gnu.org/licenses/>.
 
-import sys
 import os.path
 import re
+import sys
 
 if len(sys.argv) != 3:
     print("syntax: %s TOP-SRCDIR TOP-BUILDDIR\n" % sys.argv[0], file=sys.stderr)
index d11dfb1809e7362a7df2b9dd6eb6cb412f511a3d..e10f7f79a7f6cad5d14c20c2d4ae3b1292e3777a 100755 (executable)
@@ -20,9 +20,9 @@
 # <http://www.gnu.org/licenses/>.
 #
 
-import sys
 import os
 import os.path
+import sys
 
 separator = "/*" + ("*" * 50) + "*\n"
 wmi_classes_by_name = {}
index 1c2364f6b67e334ff36744f3c1810b063c28312f..bb751b97d3372b4a88a2908f8fec48efab2f9700 100755 (executable)
@@ -1,8 +1,8 @@
 #!/usr/bin/env python3
 
 import os
-import sys
 import shutil
+import sys
 
 meson_build_root = sys.argv[1]
 file_name = sys.argv[2]
index f109cad66e8c4f220b3d622884ff07b966cd01ca..01dc794a5ad35d830dd9be02cdf95b4deb84c46b 100755 (executable)
@@ -1,7 +1,6 @@
 #!/usr/bin/env python3
 
 import os
-
 from datetime import datetime, timezone
 
 timestamp = os.environ.get('SOURCE_DATE_EPOCH', None)
index b5e738def761d8418d7d39af85112a8df175fa88..65181b6f9037e7a7f0f211de9b5262b2a6da7e4b 100755 (executable)
@@ -2,11 +2,12 @@
 
 import argparse
 import copy
-import lark
 import os
 import re
 import xml.etree.ElementTree
 
+import lark
+
 
 def translate_vendor(name):
     T = {
index b5641f7c16924d21682a662bb15c5d5d898c1f30..37fb2e3791cb97763d5d89480e26942fbbc3815e 100755 (executable)
@@ -10,7 +10,6 @@ import subprocess
 import sys
 import xml.etree.ElementTree
 
-
 _KEYS = {
     "cpuid": ["eax_in", "ecx_in"],
     "msr": ["index"],
index ce3a599107d88d0b3ae9e570d25b2d6499a08cba..f4ed798ec4792599d7b37266672cd7e39b5fbe23 100755 (executable)
@@ -19,8 +19,8 @@
 
 import os
 import os.path
-import sys
 import subprocess
+import sys
 
 builddir = os.getenv("abs_top_builddir")
 if builddir is None:
index dfbaa1ff0c10c155860bc1f2663ad2689d94e04c..dcdb24b9a9eb2a7eacfb416f0e2a1ba56d550289 100755 (executable)
@@ -2,16 +2,17 @@
 
 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
 
+import libvirt
+
+import libvirt_qemu
 
 debug = False
 
index 7a8c3205e75470ea2db65a4a0c4f7500433c202b..209f19a4a8e47b2a972489dc60f27cc3b20ceb65 100755 (executable)
 
 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, modes
 
+import libvirt
 
 from lxml import etree
-import libvirt
 
 log = logging.getLogger()