Skip to content

Commit

Permalink
HMB generation CLI now with --s3-unsigned option to use unsigned config
Browse files Browse the repository at this point in the history
  • Loading branch information
carueda committed Aug 26, 2024
1 parent 9af809e commit a7bb2c6
Show file tree
Hide file tree
Showing 5 changed files with 58 additions and 44 deletions.
2 changes: 2 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@

2024-08

- 1.4.1 - HMB generation CLI now with `--s3-unsigned` option to use unsigned config.

- 1.4.0 with improved "meta-gen" functionality

- 1.3.0 while retying clean publishing to pypi
Expand Down
19 changes: 12 additions & 7 deletions pbp/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,16 +24,21 @@ def main():
)

s3_client = None
if opts.s3:
if opts.s3 or opts.s3_unsigned:
# pylint: disable=import-outside-toplevel
import boto3
import botocore
from botocore.config import Config

kwargs = {}
aws_region = os.getenv("AWS_REGION")
if aws_region is not None:
kwargs["region_name"] = aws_region

s3_client = boto3.client("s3", **kwargs)
if opts.s3:
kwargs = {}
aws_region = os.getenv("AWS_REGION")
if aws_region is not None:
kwargs["region_name"] = aws_region
s3_client = boto3.client("s3", **kwargs)
else:
config = Config(signature_version=botocore.UNSIGNED)
s3_client = boto3.client("s3", config=config)

gs_client = None
if opts.gs:
Expand Down
9 changes: 8 additions & 1 deletion pbp/main_args.py
Original file line number Diff line number Diff line change
Expand Up @@ -139,7 +139,14 @@ def parse_arguments():
"--s3",
default=False,
action="store_true",
help="s3 access involved.",
help="s3 access is involved, possibly with required credentials.",
)

parser.add_argument(
"--s3-unsigned",
default=False,
action="store_true",
help="s3 access is involved, not requiring credentials.",
)

parser.add_argument(
Expand Down
70 changes: 35 additions & 35 deletions poetry.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ build-backend = "poetry.core.masonry.api"

[tool.poetry]
name = "mbari-pbp"
version = "1.4.0"
version = "1.4.1"
description = "PyPAM based Processing"
authors = [
"Carlos Rueda <[email protected]>",
Expand Down

0 comments on commit a7bb2c6

Please sign in to comment.