From: Eric Blake Date: Mon, 15 Feb 2021 22:05:18 +0000 (-0600) Subject: iotests: Fix up python style in 300 X-Git-Tag: v6.0.0-rc0~54^2~25 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=4aa6fc69e8d2d64d37af382854ff5b12675248c2;p=thirdparty%2Fqemu.git iotests: Fix up python style in 300 Break some long lines, and relax our type hints to be more generic to any JSON, in order to more easily permit the additional JSON depth now possible in migration parameters. Detected by iotest 297. Fixes: ca4bfec41d56 (qemu-iotests: 300: Add test case for modifying persistence of bitmap) Reported-by: Kevin Wolf Signed-off-by: Eric Blake Message-Id: <20210215220518.1745469-1-eblake@redhat.com> Reviewed-by: John Snow Reviewed-by: Vladimir Sementsov-Ogievskiy Signed-off-by: Kevin Wolf --- diff --git a/tests/qemu-iotests/300 b/tests/qemu-iotests/300 index 63036f6a6e1..adb92762974 100755 --- a/tests/qemu-iotests/300 +++ b/tests/qemu-iotests/300 @@ -22,7 +22,7 @@ import os import random import re -from typing import Dict, List, Optional, Union +from typing import Dict, List, Optional import iotests @@ -30,7 +30,7 @@ import iotests # pylint: disable=wrong-import-order import qemu -BlockBitmapMapping = List[Dict[str, Union[str, List[Dict[str, str]]]]] +BlockBitmapMapping = List[Dict[str, object]] mig_sock = os.path.join(iotests.sock_dir, 'mig_sock') @@ -602,7 +602,8 @@ class TestCrossAliasMigration(TestDirtyBitmapMigration): class TestAliasTransformMigration(TestDirtyBitmapMigration): """ - Tests the 'transform' option which modifies bitmap persistence on migration. + Tests the 'transform' option which modifies bitmap persistence on + migration. """ src_node_name = 'node-a' @@ -674,7 +675,8 @@ class TestAliasTransformMigration(TestDirtyBitmapMigration): bitmaps = self.vm_b.query_bitmaps() for node in bitmaps: - bitmaps[node] = sorted(((bmap['name'], bmap['persistent']) for bmap in bitmaps[node])) + bitmaps[node] = sorted(((bmap['name'], bmap['persistent']) + for bmap in bitmaps[node])) self.assertEqual(bitmaps, {'node-a': [('bmap-a', True), ('bmap-b', False)],