Merge "Handle file removal concurrency"
This commit is contained in:
commit
7af23e5159
@ -124,9 +124,13 @@ def make_dir(dirname):
|
||||
def remove_file(filename):
|
||||
if os.path.isfile(filename):
|
||||
LOG.debug("Remove file: '%s'", filename)
|
||||
try:
|
||||
os.unlink(filename)
|
||||
return True
|
||||
except FileNotFoundError:
|
||||
LOG.debug("File concurrently removed: '%s'", filename)
|
||||
else:
|
||||
LOG.debug("File removed: '%s'", filename)
|
||||
return True
|
||||
return False
|
||||
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user