Commit edb60c79 authored by Arnaud Fontaine's avatar Arnaud Fontaine

When migrating a Document to ZODB, make sure it is removed on the filesystem if there was no error.

parent 24162a72
...@@ -3657,10 +3657,12 @@ class FilesystemToZodbTemplateItem(FilesystemDocumentTemplateItem, ...@@ -3657,10 +3657,12 @@ class FilesystemToZodbTemplateItem(FilesystemDocumentTemplateItem,
filesystem_path, filesystem_path,
filesystem_file, filesystem_file,
class_id).aq_base class_id).aq_base
finally: finally:
filesystem_file.close() filesystem_file.close()
os.remove(filesystem_path)
# Delete the file only if there was no error encountered during
# migration
os.remove(filesystem_path)
# Update 'migrate_object_dict' with the new path # Update 'migrate_object_dict' with the new path
key = '%s/%s' % (self._tool_id, migrated_object.getId()) key = '%s/%s' % (self._tool_id, migrated_object.getId())
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment