Skip to content

Commit

Permalink
Issue #3020: Archived S3 files shall be excluded from pipe storage & …
Browse files Browse the repository at this point in the history
…pipe mount operations - pipe storage cp/mv
  • Loading branch information
ekazachkova committed Jan 26, 2023
1 parent a8bf01a commit f2fb586
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions pipe-cli/src/utilities/datastorage_operations.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,8 @@
import datetime
import prettytable
import sys

from botocore.exceptions import ClientError
from future.utils import iteritems
from operator import itemgetter

Expand Down Expand Up @@ -642,6 +644,12 @@ def _transfer_item(cls, item, manager, source_wrapper, destination_wrapper, tran
transfer_results = cls._flush_transfer_results(source_wrapper, destination_wrapper,
transfer_results, clean=clean)
except Exception as e:
if isinstance(e, ClientError) \
and e.message and 'InvalidObjectState' in e.message and 'storage class' in e.message:
if not quiet:
click.echo(u'File {} transferring has failed. Archived file shall be restored first.'
.format(full_path))
return transfer_results, fail_after_exception
if on_failures == AllowedFailuresValues.FAIL:
err_msg = u'File transferring has failed {}. Exiting...'.format(full_path)
logging.warn(err_msg)
Expand Down

0 comments on commit f2fb586

Please sign in to comment.