Catch exception when deleting persistent file.

This commit is contained in:
Jens Luetjen 2016-03-31 23:34:57 +02:00
parent e9e9646d61
commit eb930a1679

View File

@ -211,8 +211,11 @@ class Core(
data = storage.load(file_name)
# Try only once. If something goes wrong, the next start is clean.
os.remove(file_name)
try:
# Try only once. If something goes wrong, the next start is clean.
os.remove(file_name)
except OSError:
logger.info('Failed to delete %s', file_name)
if 'state' in data:
core_state = data['state']