[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PULL 01/22] qemu-iotests: Fix FilePaths cleanup
From: |
Max Reitz |
Subject: |
[PULL 01/22] qemu-iotests: Fix FilePaths cleanup |
Date: |
Tue, 15 Sep 2020 12:46:06 +0200 |
From: Nir Soffer <nirsof@gmail.com>
If os.remove() fails to remove one of the paths, for example if the file
was removed by the test, the cleanup loop would exit silently, without
removing the rest of the files.
Fixes: de263986b5dc
Signed-off-by: Nir Soffer <nsoffer@redhat.com>
Reviewed-by: Max Reitz <mreitz@redhat.com>
Message-Id: <20200828232152.205833-2-nsoffer@redhat.com>
Signed-off-by: Max Reitz <mreitz@redhat.com>
---
tests/qemu-iotests/iotests.py | 8 ++++----
1 file changed, 4 insertions(+), 4 deletions(-)
diff --git a/tests/qemu-iotests/iotests.py b/tests/qemu-iotests/iotests.py
index 64ccaf9061..36814daf84 100644
--- a/tests/qemu-iotests/iotests.py
+++ b/tests/qemu-iotests/iotests.py
@@ -468,11 +468,11 @@ class FilePaths:
return self.paths
def __exit__(self, exc_type, exc_val, exc_tb):
- try:
- for path in self.paths:
+ for path in self.paths:
+ try:
os.remove(path)
- except OSError:
- pass
+ except OSError:
+ pass
return False
class FilePath(FilePaths):
--
2.26.2
- [PULL 00/22] Block patches, Max Reitz, 2020/09/15
- [PULL 01/22] qemu-iotests: Fix FilePaths cleanup,
Max Reitz <=
- [PULL 02/22] qemu-iotests: Fix FilePaths docstring, Max Reitz, 2020/09/15
- [PULL 03/22] qemu-iotests: Support varargs syntax in FilePaths, Max Reitz, 2020/09/15
- [PULL 04/22] qemu-iotests: Merge FilePaths and FilePath, Max Reitz, 2020/09/15
- [PULL 05/22] qemu-iotests: Simplify FilePath __init__, Max Reitz, 2020/09/15
- [PULL 07/22] qemu-img: avoid unaligned read requests during convert, Max Reitz, 2020/09/15
- [PULL 06/22] block/quorum.c: stable children names, Max Reitz, 2020/09/15
- [PULL 08/22] qcow2: Use macros for the L1, refcount and bitmap table entry sizes, Max Reitz, 2020/09/15
- [PULL 09/22] qcow2: Fix removal of list members from BDRVQcow2State.cluster_allocs, Max Reitz, 2020/09/15
- [PULL 11/22] qcow2: Rewrite the documentation of qcow2_alloc_cluster_offset(), Max Reitz, 2020/09/15
- [PULL 10/22] qcow2: Don't check nb_clusters when removing l2meta from the list, Max Reitz, 2020/09/15