]> git.ipfire.org Git - thirdparty/qemu.git/commitdiff
tests/functional: Fix problems in utils.py reported by pylint
authorThomas Huth <thuth@redhat.com>
Wed, 15 Oct 2025 09:54:54 +0000 (11:54 +0200)
committerThomas Huth <thuth@redhat.com>
Mon, 3 Nov 2025 07:27:58 +0000 (08:27 +0100)
- put the doc strings in the right locations (after the "def" line)
- use the right indentation (4 spaces)

Reviewed-by: Philippe Mathieu-Daudé <philmd@linaro.org>
Signed-off-by: Thomas Huth <thuth@redhat.com>
Message-ID: <20251015095454.1575318-7-thuth@redhat.com>

tests/functional/qemu_test/utils.py

index e7c8de816546a93c26bcfecb2318d426648c750a..826c267785bd91e6d446bbfd7ec70501b9b323fc 100644 (file)
@@ -17,10 +17,10 @@ def get_usernet_hostfwd_port(vm):
     res = vm.cmd('human-monitor-command', command_line='info usernet')
     return get_info_usernet_hostfwd_port(res)
 
-"""
-Round up to next power of 2
-"""
 def pow2ceil(x):
+    """
+    Round up to next power of 2
+    """
     return 1 if x == 0 else 2**(x - 1).bit_length()
 
 def file_truncate(path, size):
@@ -28,12 +28,12 @@ def file_truncate(path, size):
         with open(path, 'ab+') as fd:
             fd.truncate(size)
 
-"""
-Expand file size to next power of 2
-"""
 def image_pow2ceil_expand(path):
-        size = os.path.getsize(path)
-        size_aligned = pow2ceil(size)
-        if size != size_aligned:
-            with open(path, 'ab+') as fd:
-                fd.truncate(size_aligned)
+    """
+    Expand file size to next power of 2
+    """
+    size = os.path.getsize(path)
+    size_aligned = pow2ceil(size)
+    if size != size_aligned:
+        with open(path, 'ab+') as fd:
+            fd.truncate(size_aligned)