Skip to content
This repository has been archived by the owner on Dec 5, 2023. It is now read-only.

Commit

Permalink
Update boto3utils minimum version
Browse files Browse the repository at this point in the history
  • Loading branch information
trevorskaggs authored Jul 19, 2021
2 parents a5b0272 + bd7457b commit 88ae8ac
Show file tree
Hide file tree
Showing 5 changed files with 17 additions and 10 deletions.
9 changes: 8 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,12 @@ and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.

## [Unreleased]

## [v0.4.6] - 2021-07-15

### Changed
- Update boto3-utils minimum version
- `get_s3_session` now only handles error from missing secrets when trying to get bucket credentials

## [v0.4.5] - 2021-07-12

### Fixed
Expand Down Expand Up @@ -129,7 +135,8 @@ and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.

Initial Release

[Unreleased]: https://github.com/cirrus-geo/cirrus-lib/compare/v0.4.5...main
[Unreleased]: https://github.com/cirrus-geo/cirrus-lib/compare/v0.4.6...main
[v0.4.6]: https://github.com/cirrus-geo/cirrus-lib/compare/v0.4.5...v0.4.6
[v0.4.5]: https://github.com/cirrus-geo/cirrus-lib/compare/v0.4.4...v0.4.5
[v0.4.4]: https://github.com/cirrus-geo/cirrus-lib/compare/v0.4.3...v0.4.4
[v0.4.3]: https://github.com/cirrus-geo/cirrus-lib/compare/v0.4.2...v0.4.3
Expand Down
9 changes: 4 additions & 5 deletions cirruslib/transfer.py
Original file line number Diff line number Diff line change
Expand Up @@ -47,11 +47,10 @@ def get_s3_session(bucket: str=None, s3url: str=None, **kwargs) -> s3:
_creds = secrets.get_secret(secret_name)
creds.update(_creds)
except ClientError as e:
if e.response["Error"]["Code"] == "ResourceNotFoundException":
logger.info(f"Secret not found, using default credentials: '{secret_name}'")
pass
# some other client error we cannot handle
raise e
if e.response["Error"]["Code"] != "ResourceNotFoundException":
# some other client error we cannot handle
raise e
logger.info(f"Secret not found, using default credentials: '{secret_name}'")


requester_pays = creds.pop('requester_pays', False)
Expand Down
2 changes: 1 addition & 1 deletion cirruslib/version.py
Original file line number Diff line number Diff line change
@@ -1 +1 @@
__version__ = '0.4.5'
__version__ = '0.4.6'
2 changes: 1 addition & 1 deletion requirements.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
boto3-utils~=0.3.1
boto3-utils~=0.3.2
pystac~=0.5.0
requests>=2.24.0
python-json-logger~=2.0
5 changes: 3 additions & 2 deletions tests/test_transfer.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# import moto before any boto3 module
from moto import mock_s3
from moto import mock_s3, mock_secretsmanager
import boto3
import os
import unittest
Expand All @@ -12,6 +12,7 @@
testbucket = 'testbucket'

@mock_s3
@mock_secretsmanager
class Test(unittest.TestCase):

def setUp(self):
Expand Down Expand Up @@ -74,4 +75,4 @@ def test_get_path(self):
path_template = 's3://testbucket/${collection}/${id}'
item = self.get_test_item()
path = transfer.get_path(self.get_test_item(), template = path_template)
assert(path == f"s3://{testbucket}/{item['collection']}/{item['id']}")
assert(path == f"s3://{testbucket}/{item['collection']}/{item['id']}")

0 comments on commit 88ae8ac

Please sign in to comment.