mirror of
https://github.com/home-assistant/core.git
synced 2025-07-22 20:57:21 +00:00
Upgrade boto3 to 1.20.24 + aiobotocore to 2.1.0 (#64045)
This commit is contained in:
parent
0407f60955
commit
b17860a7dd
@ -2,7 +2,7 @@
|
|||||||
"domain": "amazon_polly",
|
"domain": "amazon_polly",
|
||||||
"name": "Amazon Polly",
|
"name": "Amazon Polly",
|
||||||
"documentation": "https://www.home-assistant.io/integrations/amazon_polly",
|
"documentation": "https://www.home-assistant.io/integrations/amazon_polly",
|
||||||
"requirements": ["boto3==1.16.52"],
|
"requirements": ["boto3==1.20.24"],
|
||||||
"codeowners": [],
|
"codeowners": [],
|
||||||
"iot_class": "cloud_push"
|
"iot_class": "cloud_push"
|
||||||
}
|
}
|
||||||
|
@ -165,14 +165,14 @@ async def _validate_aws_credentials(hass, credential):
|
|||||||
del aws_config[CONF_VALIDATE]
|
del aws_config[CONF_VALIDATE]
|
||||||
|
|
||||||
if (profile := aws_config.get(CONF_PROFILE_NAME)) is not None:
|
if (profile := aws_config.get(CONF_PROFILE_NAME)) is not None:
|
||||||
session = aiobotocore.AioSession(profile=profile)
|
session = aiobotocore.session.AioSession(profile=profile)
|
||||||
del aws_config[CONF_PROFILE_NAME]
|
del aws_config[CONF_PROFILE_NAME]
|
||||||
if CONF_ACCESS_KEY_ID in aws_config:
|
if CONF_ACCESS_KEY_ID in aws_config:
|
||||||
del aws_config[CONF_ACCESS_KEY_ID]
|
del aws_config[CONF_ACCESS_KEY_ID]
|
||||||
if CONF_SECRET_ACCESS_KEY in aws_config:
|
if CONF_SECRET_ACCESS_KEY in aws_config:
|
||||||
del aws_config[CONF_SECRET_ACCESS_KEY]
|
del aws_config[CONF_SECRET_ACCESS_KEY]
|
||||||
else:
|
else:
|
||||||
session = aiobotocore.AioSession()
|
session = aiobotocore.session.AioSession()
|
||||||
|
|
||||||
if credential[CONF_VALIDATE]:
|
if credential[CONF_VALIDATE]:
|
||||||
async with session.create_client("iam", **aws_config) as client:
|
async with session.create_client("iam", **aws_config) as client:
|
||||||
|
@ -2,7 +2,7 @@
|
|||||||
"domain": "aws",
|
"domain": "aws",
|
||||||
"name": "Amazon Web Services (AWS)",
|
"name": "Amazon Web Services (AWS)",
|
||||||
"documentation": "https://www.home-assistant.io/integrations/aws",
|
"documentation": "https://www.home-assistant.io/integrations/aws",
|
||||||
"requirements": ["aiobotocore==1.2.2"],
|
"requirements": ["aiobotocore==2.1.0"],
|
||||||
"codeowners": [],
|
"codeowners": [],
|
||||||
"iot_class": "cloud_push"
|
"iot_class": "cloud_push"
|
||||||
}
|
}
|
||||||
|
@ -27,7 +27,7 @@ _LOGGER = logging.getLogger(__name__)
|
|||||||
|
|
||||||
async def get_available_regions(hass, service):
|
async def get_available_regions(hass, service):
|
||||||
"""Get available regions for a service."""
|
"""Get available regions for a service."""
|
||||||
session = aiobotocore.get_session()
|
session = aiobotocore.session.get_session()
|
||||||
return await session.get_available_regions(service)
|
return await session.get_available_regions(service)
|
||||||
|
|
||||||
|
|
||||||
@ -83,10 +83,10 @@ async def async_get_service(hass, config, discovery_info=None):
|
|||||||
|
|
||||||
if session is None:
|
if session is None:
|
||||||
if (profile := aws_config.get(CONF_PROFILE_NAME)) is not None:
|
if (profile := aws_config.get(CONF_PROFILE_NAME)) is not None:
|
||||||
session = aiobotocore.AioSession(profile=profile)
|
session = aiobotocore.session.AioSession(profile=profile)
|
||||||
del aws_config[CONF_PROFILE_NAME]
|
del aws_config[CONF_PROFILE_NAME]
|
||||||
else:
|
else:
|
||||||
session = aiobotocore.AioSession()
|
session = aiobotocore.session.AioSession()
|
||||||
|
|
||||||
aws_config[CONF_REGION] = region_name
|
aws_config[CONF_REGION] = region_name
|
||||||
|
|
||||||
|
@ -2,7 +2,7 @@
|
|||||||
"domain": "route53",
|
"domain": "route53",
|
||||||
"name": "AWS Route53",
|
"name": "AWS Route53",
|
||||||
"documentation": "https://www.home-assistant.io/integrations/route53",
|
"documentation": "https://www.home-assistant.io/integrations/route53",
|
||||||
"requirements": ["boto3==1.16.52"],
|
"requirements": ["boto3==1.20.24"],
|
||||||
"codeowners": [],
|
"codeowners": [],
|
||||||
"iot_class": "cloud_push"
|
"iot_class": "cloud_push"
|
||||||
}
|
}
|
||||||
|
@ -147,7 +147,7 @@ aioasuswrt==1.4.0
|
|||||||
aioazuredevops==1.3.5
|
aioazuredevops==1.3.5
|
||||||
|
|
||||||
# homeassistant.components.aws
|
# homeassistant.components.aws
|
||||||
aiobotocore==1.2.2
|
aiobotocore==2.1.0
|
||||||
|
|
||||||
# homeassistant.components.dhcp
|
# homeassistant.components.dhcp
|
||||||
aiodiscover==1.4.5
|
aiodiscover==1.4.5
|
||||||
@ -442,7 +442,7 @@ boschshcpy==0.2.28
|
|||||||
|
|
||||||
# homeassistant.components.amazon_polly
|
# homeassistant.components.amazon_polly
|
||||||
# homeassistant.components.route53
|
# homeassistant.components.route53
|
||||||
boto3==1.16.52
|
boto3==1.20.24
|
||||||
|
|
||||||
# homeassistant.components.braviatv
|
# homeassistant.components.braviatv
|
||||||
bravia-tv==1.0.11
|
bravia-tv==1.0.11
|
||||||
|
@ -100,7 +100,7 @@ aioasuswrt==1.4.0
|
|||||||
aioazuredevops==1.3.5
|
aioazuredevops==1.3.5
|
||||||
|
|
||||||
# homeassistant.components.aws
|
# homeassistant.components.aws
|
||||||
aiobotocore==1.2.2
|
aiobotocore==2.1.0
|
||||||
|
|
||||||
# homeassistant.components.dhcp
|
# homeassistant.components.dhcp
|
||||||
aiodiscover==1.4.5
|
aiodiscover==1.4.5
|
||||||
|
@ -29,10 +29,14 @@ class MockAioSession:
|
|||||||
__aexit__=AsyncMock(),
|
__aexit__=AsyncMock(),
|
||||||
)
|
)
|
||||||
|
|
||||||
|
async def get_available_regions(self, *args, **kwargs):
|
||||||
|
"""Return list of available regions."""
|
||||||
|
return ["us-east-1", "us-east-2", "us-west-1", "us-west-2"]
|
||||||
|
|
||||||
|
|
||||||
async def test_empty_config(hass):
|
async def test_empty_config(hass):
|
||||||
"""Test a default config will be create for empty config."""
|
"""Test a default config will be create for empty config."""
|
||||||
with async_patch("aiobotocore.AioSession", new=MockAioSession):
|
with async_patch("aiobotocore.session.AioSession", new=MockAioSession):
|
||||||
await async_setup_component(hass, "aws", {"aws": {}})
|
await async_setup_component(hass, "aws", {"aws": {}})
|
||||||
await hass.async_block_till_done()
|
await hass.async_block_till_done()
|
||||||
|
|
||||||
@ -47,7 +51,7 @@ async def test_empty_config(hass):
|
|||||||
|
|
||||||
async def test_empty_credential(hass):
|
async def test_empty_credential(hass):
|
||||||
"""Test a default config will be create for empty credential section."""
|
"""Test a default config will be create for empty credential section."""
|
||||||
with async_patch("aiobotocore.AioSession", new=MockAioSession):
|
with async_patch("aiobotocore.session.AioSession", new=MockAioSession):
|
||||||
await async_setup_component(
|
await async_setup_component(
|
||||||
hass,
|
hass,
|
||||||
"aws",
|
"aws",
|
||||||
@ -80,7 +84,7 @@ async def test_empty_credential(hass):
|
|||||||
|
|
||||||
async def test_profile_credential(hass):
|
async def test_profile_credential(hass):
|
||||||
"""Test credentials with profile name."""
|
"""Test credentials with profile name."""
|
||||||
with async_patch("aiobotocore.AioSession", new=MockAioSession):
|
with async_patch("aiobotocore.session.AioSession", new=MockAioSession):
|
||||||
await async_setup_component(
|
await async_setup_component(
|
||||||
hass,
|
hass,
|
||||||
"aws",
|
"aws",
|
||||||
@ -118,7 +122,7 @@ async def test_profile_credential(hass):
|
|||||||
|
|
||||||
async def test_access_key_credential(hass):
|
async def test_access_key_credential(hass):
|
||||||
"""Test credentials with access key."""
|
"""Test credentials with access key."""
|
||||||
with async_patch("aiobotocore.AioSession", new=MockAioSession):
|
with async_patch("aiobotocore.session.AioSession", new=MockAioSession):
|
||||||
await async_setup_component(
|
await async_setup_component(
|
||||||
hass,
|
hass,
|
||||||
"aws",
|
"aws",
|
||||||
@ -163,7 +167,7 @@ async def test_access_key_credential(hass):
|
|||||||
|
|
||||||
async def test_notify_credential(hass):
|
async def test_notify_credential(hass):
|
||||||
"""Test notify service can use access key directly."""
|
"""Test notify service can use access key directly."""
|
||||||
with async_patch("aiobotocore.AioSession", new=MockAioSession):
|
with async_patch("aiobotocore.session.AioSession", new=MockAioSession):
|
||||||
await async_setup_component(
|
await async_setup_component(
|
||||||
hass,
|
hass,
|
||||||
"aws",
|
"aws",
|
||||||
@ -197,7 +201,7 @@ async def test_notify_credential(hass):
|
|||||||
|
|
||||||
async def test_notify_credential_profile(hass):
|
async def test_notify_credential_profile(hass):
|
||||||
"""Test notify service can use profile directly."""
|
"""Test notify service can use profile directly."""
|
||||||
with async_patch("aiobotocore.AioSession", new=MockAioSession):
|
with async_patch("aiobotocore.session.AioSession", new=MockAioSession):
|
||||||
await async_setup_component(
|
await async_setup_component(
|
||||||
hass,
|
hass,
|
||||||
"aws",
|
"aws",
|
||||||
@ -229,7 +233,7 @@ async def test_notify_credential_profile(hass):
|
|||||||
|
|
||||||
async def test_credential_skip_validate(hass):
|
async def test_credential_skip_validate(hass):
|
||||||
"""Test credential can skip validate."""
|
"""Test credential can skip validate."""
|
||||||
with async_patch("aiobotocore.AioSession", new=MockAioSession):
|
with async_patch("aiobotocore.session.AioSession", new=MockAioSession):
|
||||||
await async_setup_component(
|
await async_setup_component(
|
||||||
hass,
|
hass,
|
||||||
"aws",
|
"aws",
|
||||||
|
Loading…
x
Reference in New Issue
Block a user