Skip to content

Commit

Permalink
Merge branch 'release-1.33.44'
Browse files Browse the repository at this point in the history
* release-1.33.44:
  Bumping version to 1.33.44
  Update changelog based on model updates
  Merge customizations for S3
  • Loading branch information
aws-sdk-python-automation committed Aug 15, 2024
2 parents 15b1a30 + 6fba3ea commit 06a4587
Show file tree
Hide file tree
Showing 9 changed files with 71 additions and 18 deletions.
22 changes: 22 additions & 0 deletions .changes/1.33.44.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
[
{
"category": "``docdb``",
"description": "This release adds Global Cluster Failover capability which enables you to change your global cluster's primary AWS region, the region that serves writes, during a regional outage. Performing a failover action preserves your Global Cluster setup.",
"type": "api-change"
},
{
"category": "``ecs``",
"description": "This release introduces a new ContainerDefinition configuration to support the customer-managed keys for ECS container restart feature.",
"type": "api-change"
},
{
"category": "``iam``",
"description": "Make the LastUsedDate field in the GetAccessKeyLastUsed response optional. This may break customers who only call the API for access keys with a valid LastUsedDate. This fixes a deserialization issue for access keys without a LastUsedDate, because the field was marked as required but could be null.",
"type": "api-change"
},
{
"category": "``s3``",
"description": "Amazon Simple Storage Service / Features : Adds support for pagination in the S3 ListBuckets API.",
"type": "api-change"
}
]
9 changes: 9 additions & 0 deletions CHANGELOG.rst
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,15 @@
CHANGELOG
=========

1.33.44
=======

* api-change:``docdb``: This release adds Global Cluster Failover capability which enables you to change your global cluster's primary AWS region, the region that serves writes, during a regional outage. Performing a failover action preserves your Global Cluster setup.
* api-change:``ecs``: This release introduces a new ContainerDefinition configuration to support the customer-managed keys for ECS container restart feature.
* api-change:``iam``: Make the LastUsedDate field in the GetAccessKeyLastUsed response optional. This may break customers who only call the API for access keys with a valid LastUsedDate. This fixes a deserialization issue for access keys without a LastUsedDate, because the field was marked as required but could be null.
* api-change:``s3``: Amazon Simple Storage Service / Features : Adds support for pagination in the S3 ListBuckets API.


1.33.43
=======

Expand Down
2 changes: 1 addition & 1 deletion awscli/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
"""
import os

__version__ = '1.33.43'
__version__ = '1.33.44'

#
# Get our data path to be added to botocore's search path
Expand Down
24 changes: 16 additions & 8 deletions awscli/customizations/s3/subcommands.py
Original file line number Diff line number Diff line change
Expand Up @@ -497,7 +497,7 @@ def _run_main(self, parsed_args, parsed_globals):
path = path[5:]
bucket, key = find_bucket_key(path)
if not bucket:
self._list_all_buckets()
self._list_all_buckets(parsed_args.page_size)
elif parsed_args.dir_op:
# Then --recursive was specified.
self._list_all_objects_recursive(
Expand Down Expand Up @@ -561,13 +561,21 @@ def _display_page(self, response_data, use_basename=True):
uni_print(print_str)
self._at_first_page = False

def _list_all_buckets(self):
response_data = self.client.list_buckets()
buckets = response_data['Buckets']
for bucket in buckets:
last_mod_str = self._make_last_mod_str(bucket['CreationDate'])
print_str = last_mod_str + ' ' + bucket['Name'] + '\n'
uni_print(print_str)
def _list_all_buckets(self, page_size=None):
paginator = self.client.get_paginator('list_buckets')
paging_args = {
'PaginationConfig': {'PageSize': page_size}
}

iterator = paginator.paginate(**paging_args)

for response_data in iterator:
buckets = response_data.get('Buckets', [])

for bucket in buckets:
last_mod_str = self._make_last_mod_str(bucket['CreationDate'])
print_str = last_mod_str + ' ' + bucket['Name'] + '\n'
uni_print(print_str)

def _list_all_objects_recursive(self, bucket, key, page_size=None,
request_payer=None):
Expand Down
2 changes: 1 addition & 1 deletion doc/source/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@
# The short X.Y version.
version = '1.33.'
# The full version, including alpha/beta/rc tags.
release = '1.33.43'
release = '1.33.44'

# The language for content autogenerated by Sphinx. Refer to documentation
# for a list of supported languages.
Expand Down
2 changes: 1 addition & 1 deletion setup.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ universal = 0

[metadata]
requires_dist =
botocore==1.34.161
botocore==1.34.162
docutils>=0.10,<0.17
s3transfer>=0.10.0,<0.11.0
PyYAML>=3.10,<6.1
Expand Down
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ def find_version(*file_paths):


install_requires = [
'botocore==1.34.161',
'botocore==1.34.162',
'docutils>=0.10,<0.17',
's3transfer>=0.10.0,<0.11.0',
'PyYAML>=3.10,<6.1',
Expand Down
6 changes: 6 additions & 0 deletions tests/functional/s3/test_ls_command.py
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,12 @@ def test_errors_out_with_extra_arguments(self):
self.assertIn('Unknown options', stderr)
self.assertIn('--extra-argument-foo', stderr)

def test_list_buckets_use_page_size(self):
stdout, _, _ = self.run_cmd('s3 ls --page-size 8', expected_rc=0)
call_args = self.operations_called[0][1]
# The page size gets translated to ``MaxBuckets`` in the s3 model
self.assertEqual(call_args['MaxBuckets'], 8)

def test_operations_use_page_size(self):
time_utc = "2014-01-09T20:45:49.000Z"
self.parsed_responses = [{"CommonPrefixes": [], "Contents": [
Expand Down
20 changes: 14 additions & 6 deletions tests/unit/customizations/s3/test_subcommands.py
Original file line number Diff line number Diff line change
Expand Up @@ -115,13 +115,21 @@ def test_ls_command_with_no_args(self):
verify_ssl=None)
parsed_args = FakeArgs(dir_op=False, paths='s3://',
human_readable=False, summarize=False,
request_payer=None)
request_payer=None, page_size=None)
ls_command._run_main(parsed_args, parsed_global)
# We should only be a single call.
call = self.session.create_client.return_value.list_buckets
self.assertTrue(call.called)
self.assertEqual(call.call_count, 1)
self.assertEqual(call.call_args[1], {})
paginate = self.session.create_client.return_value.get_paginator\
.return_value.paginate

# We should make no operation calls.
self.assertEqual(call.call_count, 0)
# And only a single pagination call to ListBuckets.
self.session.create_client.return_value.get_paginator.\
assert_called_with('list_buckets')
ref_call_args = {'PaginationConfig': {'PageSize': None}}

paginate.assert_called_with(**ref_call_args)

# Verify get_client
get_client = self.session.create_client
args = get_client.call_args
Expand All @@ -136,7 +144,7 @@ def test_ls_with_verify_argument(self):
verify_ssl=False)
parsed_args = FakeArgs(paths='s3://', dir_op=False,
human_readable=False, summarize=False,
request_payer=None)
request_payer=None, page_size=None)
ls_command._run_main(parsed_args, parsed_global)
# Verify get_client
get_client = self.session.create_client
Expand Down

0 comments on commit 06a4587

Please sign in to comment.