Commit f901ed5a authored by Łukasz Nowak's avatar Łukasz Nowak

- do not allow to proceed with restoration if cutting is requested and index...

 - do not allow to proceed with restoration if cutting is requested and index file exists, as bug in ZODB will prevent cutting at given transaction id


git-svn-id: https://svn.erp5.org/repos/public/erp5/trunk@25867 20353a03-c40f-0410-a6d1-a30d3c3de9de
parent 507f8a42
......@@ -108,6 +108,17 @@ def recover(known_tid_storage_identifier_dict, repozo_formated_command, check=Fa
"""Recovers all ZODB files, when last_tid_dict is passed cut them at proper byte"""
recovered_count = 0
total_count = len(known_tid_storage_identifier_dict)
result = 0
for key, (file_path, storage_path, object_path) in known_tid_storage_identifier_dict.iteritems():
# check that indexes do not exists if cut shall be done
file_index = file_path + ".index"
if os.access(file_index, os.F_OK) and last_tid_dict is not None:
log('Error: Index file %s exists. Bug in ZODB makes it impossible to cut'
' indexed file after restore. Cannot continue.' %
file_index)
result = 1
if result:
return result
for key, (file_path, storage_path, object_path) in known_tid_storage_identifier_dict.iteritems():
if not os.access(storage_path, os.R_OK):
log('Warning: unable to recover %s because %s is missing/unreadable.' % (file_path, storage_path))
......
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