Skip to content

support 403 in get_policy call #894

@gemal

Description

@gemal

the info_cmd code has:

            try:
                policy = s3.get_policy(uri)
                output(u"   policy:    %s" % policy)
            except S3Error as exc:
                # Ignore the exception and don't fail the info
                # if the server doesn't support setting ACLs
                if exc.status not in [404, 501]:
                    raise exc
                output(u"   policy:    none")

if I try to run it on a bucket:

[shell]# s3cmd info s3://xxxx/mysql_backup/day/backup.07.11.2017.tar.gz
s3://xxxx/mysql_backup/day/backup.07.11.2017.tar.gz (object):
   File size: 257583
   Last mod:  Tue, 11 Jul 2017 03:00:05 GMT
   MIME type: application/x-gzip
   Storage:   STANDARD
   MD5 sum:   603ee6e281fca59a77dce1a82abe5e22
   SSE:       none
ERROR: Access to bucket 'xxxx' was denied
ERROR: S3 error: 403 (AccessDenied): Access Denied

perhaps the code should also check for 403 in the ignore?

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions