[packit] 2.15.1 upstream release

- Resolves rhbz#2251124

Upstream tag: 2.15.1
Upstream commit: 09fcfba2
This commit is contained in:
Packit 2023-12-14 22:32:46 +00:00 committed by Nikola Forró
parent ec87fd2046
commit 42318b792d
5 changed files with 153 additions and 23 deletions

1
.gitignore vendored
View File

@ -25,3 +25,4 @@
/aws-cli-2.13.30.tar.gz
/aws-cli-2.13.36.tar.gz
/aws-cli-2.13.37.tar.gz
/aws-cli-2.15.1.tar.gz

View File

@ -1,3 +1,3 @@
This repository is maintained by packit.
https://packit.dev/
The file was generated using packit 0.85.0.post1.dev17+g1f3036b1.
The file was generated using packit 0.87.1.post1.dev7+g9f53ebb4.

View File

@ -1,7 +1,7 @@
%global pkgname aws-cli
Name: awscli2
Version: 2.13.37
Version: 2.15.1
Release: %autorelease
Summary: Universal Command Line Environment for AWS, version 2
@ -109,7 +109,7 @@ export TESTS_REMOVE_REPO_ROOT_FROM_PATH=1 TZ=UTC
%if 0%{?rhel}
export OPENSSL_ENABLE_SHA1_SIGNATURES=yes
%endif
%pytest --verbose %{!?rhel:--numprocesses=auto --dist=loadfile} tests/unit tests/functional
%pytest --verbose %{!?rhel:--numprocesses=auto --dist=loadfile --maxprocesses=4} tests/unit tests/functional
%files -f %{pyproject_files}

View File

@ -40,7 +40,7 @@ index 868bd5d..3eaf662 100644
self.tree.write()
self.tree = HTMLTree(self.doc)
diff --git a/awscli/botocore/auth.py b/awscli/botocore/auth.py
index edae233..e2536a5 100644
index e8c83ad..e50be2a 100644
--- a/awscli/botocore/auth.py
+++ b/awscli/botocore/auth.py
@@ -396,7 +396,7 @@ class SigV4Auth(BaseSigner):
@ -61,7 +61,16 @@ index edae233..e2536a5 100644
request.headers['Date'] = formatdate(
int(calendar.timegm(datetime_timestamp.timetuple())))
if 'X-Amz-Date' in request.headers:
@@ -611,7 +611,7 @@ class S3SigV4PostAuth(SigV4Auth):
@@ -528,7 +528,7 @@ class S3ExpressPostAuth(S3ExpressAuth):
REQUIRES_IDENTITY_CACHE = True
def add_auth(self, request):
- datetime_now = datetime.datetime.utcnow()
+ datetime_now = datetime.datetime.now(datetime.timezone.utc)
request.context['timestamp'] = datetime_now.strftime(SIGV4_TIMESTAMP)
fields = {}
@@ -781,7 +781,7 @@ class S3SigV4PostAuth(SigV4Auth):
http://docs.aws.amazon.com/AmazonS3/latest/API/sigv4-UsingHTTPPOST.html
"""
def add_auth(self, request):
@ -109,23 +118,27 @@ index 3d1de2f..d8120c6 100644
path=_unicode_path(path))
else:
diff --git a/awscli/botocore/crt/auth.py b/awscli/botocore/crt/auth.py
index 534a7f8..e3337f5 100644
index 534a7f8..5046b35 100644
--- a/awscli/botocore/crt/auth.py
+++ b/awscli/botocore/crt/auth.py
@@ -57,8 +57,7 @@ class CrtSigV4Auth(BaseSigner):
@@ -55,10 +55,7 @@ class CrtSigV4Auth(BaseSigner):
if self.credentials is None:
raise NoCredentialsError()
# Use utcnow() because that's what gets mocked by tests, but set
# timezone because CRT assumes naive datetime is local time.
- # Use utcnow() because that's what gets mocked by tests, but set
- # timezone because CRT assumes naive datetime is local time.
- datetime_now = datetime.datetime.utcnow().replace(
- tzinfo=datetime.timezone.utc)
+ datetime_now = datetime.datetime.now(datetime.timezone.utc)
# Use existing 'X-Amz-Content-SHA256' header if able
existing_sha256 = self._get_existing_sha256(request)
@@ -247,8 +246,7 @@ class CrtSigV4AsymAuth(BaseSigner):
@@ -245,10 +242,7 @@ class CrtSigV4AsymAuth(BaseSigner):
if self.credentials is None:
raise NoCredentialsError()
# Use utcnow() because that's what gets mocked by tests, but set
# timezone because CRT assumes naive datetime is local time.
- # Use utcnow() because that's what gets mocked by tests, but set
- # timezone because CRT assumes naive datetime is local time.
- datetime_now = datetime.datetime.utcnow().replace(
- tzinfo=datetime.timezone.utc)
+ datetime_now = datetime.datetime.now(datetime.timezone.utc)
@ -219,10 +232,10 @@ index ffca974..367c867 100644
},
'ResponseMetadata': {
diff --git a/awscli/botocore/signers.py b/awscli/botocore/signers.py
index 77a9346..7bbb6cf 100644
index 57df023..7ff87e4 100644
--- a/awscli/botocore/signers.py
+++ b/awscli/botocore/signers.py
@@ -532,7 +532,7 @@ class S3PostPresigner(object):
@@ -549,7 +549,7 @@ class S3PostPresigner(object):
policy = {}
# Create an expiration date for the policy
@ -232,10 +245,10 @@ index 77a9346..7bbb6cf 100644
policy['expiration'] = expire_date.strftime(botocore.auth.ISO8601)
diff --git a/awscli/botocore/utils.py b/awscli/botocore/utils.py
index 81b41dc..85e5d42 100644
index a408d9d..f4d7ece 100644
--- a/awscli/botocore/utils.py
+++ b/awscli/botocore/utils.py
@@ -70,7 +70,7 @@ from botocore.exceptions import (
@@ -72,7 +72,7 @@ from botocore.exceptions import (
UnsupportedS3ControlArnError,
UnsupportedS3ControlConfigurationError,
)
@ -244,7 +257,7 @@ index 81b41dc..85e5d42 100644
from dateutil.tz import tzutc
from urllib3.exceptions import LocationParseError
@@ -571,13 +571,13 @@ class InstanceMetadataFetcher(IMDSFetcher):
@@ -583,13 +583,13 @@ class InstanceMetadataFetcher(IMDSFetcher):
return
try:
expiration = datetime.datetime.strptime(
@ -551,6 +564,67 @@ index 7e7f619..dbdf329 100644
self.http_stubber.add_response(body=b'{}')
with self.http_stubber:
self.client.post_content(**params)
diff --git a/tests/functional/botocore/test_s3express.py b/tests/functional/botocore/test_s3express.py
index 390721e..ebb89b0 100644
--- a/tests/functional/botocore/test_s3express.py
+++ b/tests/functional/botocore/test_s3express.py
@@ -108,7 +108,6 @@ class TestS3ExpressAuth:
class TestS3ExpressIdentityCache:
def test_default_s3_express_cache(self, default_s3_client, mock_datetime):
mock_datetime.now.return_value = DATE
- mock_datetime.utcnow.return_value = DATE
identity_cache = S3ExpressIdentityCache(
default_s3_client,
@@ -126,7 +125,6 @@ class TestS3ExpressIdentityCache:
self, default_s3_client, mock_datetime
):
mock_datetime.now.return_value = DATE
- mock_datetime.utcnow.return_value = DATE
bucket = 'my_bucket'
identity_cache = S3ExpressIdentityCache(
@@ -151,7 +149,6 @@ class TestS3ExpressIdentityCache:
self, default_s3_client, mock_datetime
):
mock_datetime.now.return_value = DATE
- mock_datetime.utcnow.return_value = DATE
bucket = 'my_bucket'
other_bucket = 'other_bucket'
@@ -204,7 +201,7 @@ class TestS3ExpressRequests:
)
def test_create_bucket(self, default_s3_client, mock_datetime):
- mock_datetime.utcnow.return_value = DATE
+ mock_datetime.now.return_value = DATE
with ClientHTTPStubber(default_s3_client) as stubber:
stubber.add_response()
@@ -228,7 +225,6 @@ class TestS3ExpressRequests:
self._assert_standard_sigv4_signature(stubber.requests[0].headers)
def test_get_object(self, default_s3_client, mock_datetime):
- mock_datetime.utcnow.return_value = DATE
mock_datetime.now.return_value = DATE
with ClientHTTPStubber(default_s3_client) as stubber:
@@ -250,7 +246,6 @@ class TestS3ExpressRequests:
def test_cache_with_multiple_requests(
self, default_s3_client, mock_datetime
):
- mock_datetime.utcnow.return_value = DATE
mock_datetime.now.return_value = DATE
with ClientHTTPStubber(default_s3_client) as stubber:
@@ -275,7 +270,6 @@ class TestS3ExpressRequests:
def test_delete_objects_injects_correct_checksum(
self, default_s3_client, mock_datetime
):
- mock_datetime.utcnow.return_value = DATE
mock_datetime.now.return_value = DATE
with ClientHTTPStubber(default_s3_client) as stubber:
diff --git a/tests/functional/botocore/test_sts.py b/tests/functional/botocore/test_sts.py
index cdc212a..a279881 100644
--- a/tests/functional/botocore/test_sts.py
@ -751,6 +825,46 @@ index d6b0902..4e66fdf 100644
from botocore.exceptions import (
ConnectTimeoutError, ReadTimeoutError, EndpointConnectionError,
ConnectionClosedError, ClientError, ProxyConnectionError
diff --git a/tests/integration/customizations/test_codecommit.py b/tests/integration/customizations/test_codecommit.py
index 751e051..fc4d2c1 100644
--- a/tests/integration/customizations/test_codecommit.py
+++ b/tests/integration/customizations/test_codecommit.py
@@ -14,7 +14,7 @@
import awscli
import os
-from datetime import datetime
+from datetime import datetime, timezone
from six import StringIO
from botocore.session import Session
@@ -59,7 +59,7 @@ class TestCodeCommitCredentialHelper(unittest.TestCase):
@mock.patch('sys.stdout', new_callable=StringIOWithFileNo)
@mock.patch.object(awscli.customizations.codecommit.datetime, 'datetime')
def test_integration_using_cli_driver(self, dt_mock, stdout_mock):
- dt_mock.utcnow.return_value = datetime(2010, 10, 8)
+ dt_mock.now.return_value = datetime(2010, 10, 8, tzinfo=timezone.utc)
driver = create_clidriver()
entry_point = AWSCLIEntryPoint(driver)
rc = entry_point.main('codecommit credential-helper get'.split())
@@ -75,7 +75,7 @@ class TestCodeCommitCredentialHelper(unittest.TestCase):
@mock.patch('sys.stdout', new_callable=StringIOWithFileNo)
@mock.patch.object(awscli.customizations.codecommit.datetime, 'datetime')
def test_integration_fips_using_cli_driver(self, dt_mock, stdout_mock):
- dt_mock.utcnow.return_value = datetime(2010, 10, 8)
+ dt_mock.now.return_value = datetime(2010, 10, 8, tzinfo=timezone.utc)
driver = create_clidriver()
entry_point = AWSCLIEntryPoint(driver)
rc = entry_point.main('codecommit credential-helper get'.split())
@@ -91,7 +91,7 @@ class TestCodeCommitCredentialHelper(unittest.TestCase):
@mock.patch('sys.stdout', new_callable=StringIOWithFileNo)
@mock.patch.object(awscli.customizations.codecommit.datetime, 'datetime')
def test_integration_vpc_using_cli_driver(self, dt_mock, stdout_mock):
- dt_mock.utcnow.return_value = datetime(2010, 10, 8)
+ dt_mock.now.return_value = datetime(2010, 10, 8, tzinfo=timezone.utc)
driver = create_clidriver()
entry_point = AWSCLIEntryPoint(driver)
rc = entry_point.main('codecommit credential-helper get'.split())
diff --git a/tests/unit/botocore/auth/test_signers.py b/tests/unit/botocore/auth/test_signers.py
index 73d3b12..25ca21f 100644
--- a/tests/unit/botocore/auth/test_signers.py
@ -849,7 +963,7 @@ index f28b959..1b3d56b 100644
'the ``NextToken`` from a previous response.'),
' :returns: None',
diff --git a/tests/unit/botocore/test_credentials.py b/tests/unit/botocore/test_credentials.py
index cc49596..b6b4400 100644
index c59f278..c50f593 100644
--- a/tests/unit/botocore/test_credentials.py
+++ b/tests/unit/botocore/test_credentials.py
@@ -11,7 +11,7 @@
@ -861,6 +975,15 @@ index cc49596..b6b4400 100644
import subprocess
import mock
import os
@@ -111,7 +111,7 @@ class TestRefreshableCredentials(TestCredentials):
def test_refresh_needed(self):
# The expiry time was set for 30 minutes ago, so if we
- # say the current time is utcnow(), then we should need
+ # say the current time is now(), then we should need
# a refresh.
self.mock_time.return_value = datetime.now(tzlocal())
self.assertTrue(self.creds.refresh_needed())
@@ -291,8 +291,8 @@ class TestAssumeRoleCredentialFetcher(BaseEnvVar):
self.assertEqual(response, expected_response)
@ -942,7 +1065,7 @@ index e06e0c1..507e2ea 100644
self.client, hostname, port, username)
diff --git a/tests/unit/botocore/test_utils.py b/tests/unit/botocore/test_utils.py
index a4d7f13..e7c9af4 100644
index 1f27e25..8116070 100644
--- a/tests/unit/botocore/test_utils.py
+++ b/tests/unit/botocore/test_utils.py
@@ -98,7 +98,7 @@ from botocore.stub import Stubber
@ -963,7 +1086,7 @@ index a4d7f13..e7c9af4 100644
url='https://foo.amazonaws.com/bucket/key.txt'
)
prepared_request = request.prepare()
@@ -2794,7 +2794,7 @@ class TestInstanceMetadataFetcher(unittest.TestCase):
@@ -2819,7 +2819,7 @@ class TestInstanceMetadataFetcher(unittest.TestCase):
self, dt=None, offset=None, offset_func=operator.add
):
if dt is None:
@ -1013,10 +1136,16 @@ index 1471ba9..f6816b9 100644
def tearDown(self):
self.datetime_patcher.stop()
diff --git a/tests/utils/botocore/__init__.py b/tests/utils/botocore/__init__.py
index 9b8f205..919bccc 100644
index 9b8f205..abedac8 100644
--- a/tests/utils/botocore/__init__.py
+++ b/tests/utils/botocore/__init__.py
@@ -565,7 +565,7 @@ class FreezeTime(contextlib.ContextDecorator):
@@ -560,12 +560,12 @@ class FreezeTime(contextlib.ContextDecorator):
:param module: reference to imported module to patch (e.g. botocore.auth.datetime)
:type date: datetime.datetime
- :param date: datetime object specifying the output for utcnow()
+ :param date: datetime object specifying the output for now()
"""
def __init__(self, module, date=None):
if date is None:

View File

@ -1 +1 @@
SHA512 (aws-cli-2.13.37.tar.gz) = 6dc9b16667a00fb6ac02a7b7c9fee7da0fc1d16e16051db6d5235b933ae0d1d58de4770864d077158e9c40d089c711c11244c64f67a3b6583f91661e828790aa
SHA512 (aws-cli-2.15.1.tar.gz) = fa6856de9ebbda514fc3d27b0f25ff5282bb56567164815694286e7ad0d5f27254647feb038b39c2ebec8e5ff5e5fcb766a4ffcc3c62041273aaf1a21c11cf92