Skip to content

Commit 57d0a24

Browse files
authored
Merge pull request #9906 from aemous/debug-migration-patch
Modify debug migration s3 us-east-1 detections and switch changelog entry type to feature.
2 parents 62f1bda + 49688a6 commit 57d0a24

File tree

2 files changed

+9
-8
lines changed

2 files changed

+9
-8
lines changed
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
{
2-
"type": "enhancement",
2+
"type": "feature",
33
"category": "Migration",
44
"description": "Implement a ``--v2-debug`` flag and ``AWS_CLI_UPGRADE_DEBUG_MODE`` environment variable that detects breaking changes for AWS CLI v2 for entered commands."
55
}

awscli/customizations/globalargs.py

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -133,12 +133,12 @@ def detect_migration_breakage(parsed_args, remaining_args, session, **kwargs):
133133
out_file=sys.stderr
134134
)
135135
if (
136-
s3_config is None or (
137-
s3_config is not None and s3_config.get(
138-
'us_east_1_regional_endpoint',
139-
'legacy'
140-
) == 'legacy' and region in ('us-east-1', None)
141-
)
136+
(
137+
s3_config is None
138+
or s3_config.get('us_east_1_regional_endpoint', 'legacy')
139+
== 'legacy'
140+
)
141+
and region in ('us-east-1', None)
142142
):
143143
session.register(
144144
'request-created.s3.*',
@@ -220,7 +220,8 @@ def warn_if_east_configured_global_endpoint(request, operation_name, **kwargs):
220220
# The regional us-east-1 endpoint is used in certain cases (e.g.
221221
# FIPS/Dual-Stack is enabled). Rather than duplicating this logic
222222
# from botocore, we check the endpoint URL directly.
223-
if 's3.amazonaws.com' in request.url:
223+
parsed_url = urlparse.urlparse(request.url)
224+
if parsed_url.hostname.endswith('s3.amazonaws.com'):
224225
uni_print(
225226
'\nAWS CLI v2 UPGRADE WARNING: When you configure AWS CLI v2 to '
226227
'use the `us-east-1` region, it uses the true regional endpoint '

0 commit comments

Comments
 (0)