qemu-iotests: Fix FilePaths cleanup

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: de263986b5
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>
This commit is contained in:
Nir Soffer 2020-08-29 02:21:48 +03:00 committed by Max Reitz
parent 2d2c73d0e3
commit a7971702f4
1 changed files with 4 additions and 4 deletions

View File

@ -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):