Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Improve recursive object restore #1375

Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 9 additions & 3 deletions s3cmd
Original file line number Diff line number Diff line change
Expand Up @@ -923,6 +923,8 @@ def cmd_object_restore(args):
warning(u"Exiting now because of --dry-run")
return EX_OK

ret = EX_OK

for key in remote_list:
item = remote_list[key]

Expand All @@ -932,13 +934,17 @@ def cmd_object_restore(args):
response = s3.object_restore(S3Uri(item['object_uri_str']))
output(u"restore: '%s'" % item['object_uri_str'])
except S3Error as e:
if e.code == "RestoreAlreadyInProgress":
if e.code in ("RestoreAlreadyInProgress", "InvalidObjectState"):
warning("%s: %s" % (e.message, item['object_uri_str']))
else:
elif cfg.stop_on_error:
raise e
else:
error("restore failed for: '%s' (%s)", item['object_uri_str'], e)
ret = EX_PARTIAL

else:
debug(u"Skipping directory since only files may be restored")
return EX_OK
return ret


def subcmd_cp_mv(args, process_fce, action_str, message):
Expand Down
Loading