Skip to content

Commit 06a4587

Browse files
Merge branch 'release-1.33.44'
* release-1.33.44: Bumping version to 1.33.44 Update changelog based on model updates Merge customizations for S3
2 parents 15b1a30 + 6fba3ea commit 06a4587

File tree

9 files changed

+71
-18
lines changed

9 files changed

+71
-18
lines changed

.changes/1.33.44.json

+22
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
[
2+
{
3+
"category": "``docdb``",
4+
"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.",
5+
"type": "api-change"
6+
},
7+
{
8+
"category": "``ecs``",
9+
"description": "This release introduces a new ContainerDefinition configuration to support the customer-managed keys for ECS container restart feature.",
10+
"type": "api-change"
11+
},
12+
{
13+
"category": "``iam``",
14+
"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.",
15+
"type": "api-change"
16+
},
17+
{
18+
"category": "``s3``",
19+
"description": "Amazon Simple Storage Service / Features : Adds support for pagination in the S3 ListBuckets API.",
20+
"type": "api-change"
21+
}
22+
]

CHANGELOG.rst

+9
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,15 @@
22
CHANGELOG
33
=========
44

5+
1.33.44
6+
=======
7+
8+
* 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.
9+
* api-change:``ecs``: This release introduces a new ContainerDefinition configuration to support the customer-managed keys for ECS container restart feature.
10+
* 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.
11+
* api-change:``s3``: Amazon Simple Storage Service / Features : Adds support for pagination in the S3 ListBuckets API.
12+
13+
514
1.33.43
615
=======
716

awscli/__init__.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@
1717
"""
1818
import os
1919

20-
__version__ = '1.33.43'
20+
__version__ = '1.33.44'
2121

2222
#
2323
# Get our data path to be added to botocore's search path

awscli/customizations/s3/subcommands.py

+16-8
Original file line numberDiff line numberDiff line change
@@ -497,7 +497,7 @@ def _run_main(self, parsed_args, parsed_globals):
497497
path = path[5:]
498498
bucket, key = find_bucket_key(path)
499499
if not bucket:
500-
self._list_all_buckets()
500+
self._list_all_buckets(parsed_args.page_size)
501501
elif parsed_args.dir_op:
502502
# Then --recursive was specified.
503503
self._list_all_objects_recursive(
@@ -561,13 +561,21 @@ def _display_page(self, response_data, use_basename=True):
561561
uni_print(print_str)
562562
self._at_first_page = False
563563

564-
def _list_all_buckets(self):
565-
response_data = self.client.list_buckets()
566-
buckets = response_data['Buckets']
567-
for bucket in buckets:
568-
last_mod_str = self._make_last_mod_str(bucket['CreationDate'])
569-
print_str = last_mod_str + ' ' + bucket['Name'] + '\n'
570-
uni_print(print_str)
564+
def _list_all_buckets(self, page_size=None):
565+
paginator = self.client.get_paginator('list_buckets')
566+
paging_args = {
567+
'PaginationConfig': {'PageSize': page_size}
568+
}
569+
570+
iterator = paginator.paginate(**paging_args)
571+
572+
for response_data in iterator:
573+
buckets = response_data.get('Buckets', [])
574+
575+
for bucket in buckets:
576+
last_mod_str = self._make_last_mod_str(bucket['CreationDate'])
577+
print_str = last_mod_str + ' ' + bucket['Name'] + '\n'
578+
uni_print(print_str)
571579

572580
def _list_all_objects_recursive(self, bucket, key, page_size=None,
573581
request_payer=None):

doc/source/conf.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@
5252
# The short X.Y version.
5353
version = '1.33.'
5454
# The full version, including alpha/beta/rc tags.
55-
release = '1.33.43'
55+
release = '1.33.44'
5656

5757
# The language for content autogenerated by Sphinx. Refer to documentation
5858
# for a list of supported languages.

setup.cfg

+1-1
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ universal = 0
33

44
[metadata]
55
requires_dist =
6-
botocore==1.34.161
6+
botocore==1.34.162
77
docutils>=0.10,<0.17
88
s3transfer>=0.10.0,<0.11.0
99
PyYAML>=3.10,<6.1

setup.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ def find_version(*file_paths):
2424

2525

2626
install_requires = [
27-
'botocore==1.34.161',
27+
'botocore==1.34.162',
2828
'docutils>=0.10,<0.17',
2929
's3transfer>=0.10.0,<0.11.0',
3030
'PyYAML>=3.10,<6.1',

tests/functional/s3/test_ls_command.py

+6
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,12 @@ def test_errors_out_with_extra_arguments(self):
4040
self.assertIn('Unknown options', stderr)
4141
self.assertIn('--extra-argument-foo', stderr)
4242

43+
def test_list_buckets_use_page_size(self):
44+
stdout, _, _ = self.run_cmd('s3 ls --page-size 8', expected_rc=0)
45+
call_args = self.operations_called[0][1]
46+
# The page size gets translated to ``MaxBuckets`` in the s3 model
47+
self.assertEqual(call_args['MaxBuckets'], 8)
48+
4349
def test_operations_use_page_size(self):
4450
time_utc = "2014-01-09T20:45:49.000Z"
4551
self.parsed_responses = [{"CommonPrefixes": [], "Contents": [

tests/unit/customizations/s3/test_subcommands.py

+14-6
Original file line numberDiff line numberDiff line change
@@ -115,13 +115,21 @@ def test_ls_command_with_no_args(self):
115115
verify_ssl=None)
116116
parsed_args = FakeArgs(dir_op=False, paths='s3://',
117117
human_readable=False, summarize=False,
118-
request_payer=None)
118+
request_payer=None, page_size=None)
119119
ls_command._run_main(parsed_args, parsed_global)
120-
# We should only be a single call.
121120
call = self.session.create_client.return_value.list_buckets
122-
self.assertTrue(call.called)
123-
self.assertEqual(call.call_count, 1)
124-
self.assertEqual(call.call_args[1], {})
121+
paginate = self.session.create_client.return_value.get_paginator\
122+
.return_value.paginate
123+
124+
# We should make no operation calls.
125+
self.assertEqual(call.call_count, 0)
126+
# And only a single pagination call to ListBuckets.
127+
self.session.create_client.return_value.get_paginator.\
128+
assert_called_with('list_buckets')
129+
ref_call_args = {'PaginationConfig': {'PageSize': None}}
130+
131+
paginate.assert_called_with(**ref_call_args)
132+
125133
# Verify get_client
126134
get_client = self.session.create_client
127135
args = get_client.call_args
@@ -136,7 +144,7 @@ def test_ls_with_verify_argument(self):
136144
verify_ssl=False)
137145
parsed_args = FakeArgs(paths='s3://', dir_op=False,
138146
human_readable=False, summarize=False,
139-
request_payer=None)
147+
request_payer=None, page_size=None)
140148
ls_command._run_main(parsed_args, parsed_global)
141149
# Verify get_client
142150
get_client = self.session.create_client

0 commit comments

Comments
 (0)