Fix profile usage with aws notify platforms (#2100)
parent
a565cc4b73
commit
c96a5d5b2b
homeassistant/components/notify
|
@ -50,8 +50,10 @@ def get_service(hass, config):
|
||||||
del aws_config[CONF_NAME]
|
del aws_config[CONF_NAME]
|
||||||
del aws_config[CONF_CONTEXT]
|
del aws_config[CONF_CONTEXT]
|
||||||
|
|
||||||
if aws_config[CONF_PROFILE_NAME]:
|
profile = aws_config.get(CONF_PROFILE_NAME)
|
||||||
boto3.setup_default_session(profile_name=aws_config[CONF_PROFILE_NAME])
|
|
||||||
|
if profile is not None:
|
||||||
|
boto3.setup_default_session(profile_name=profile)
|
||||||
del aws_config[CONF_PROFILE_NAME]
|
del aws_config[CONF_PROFILE_NAME]
|
||||||
|
|
||||||
lambda_client = boto3.client("lambda", **aws_config)
|
lambda_client = boto3.client("lambda", **aws_config)
|
||||||
|
|
|
@ -41,8 +41,10 @@ def get_service(hass, config):
|
||||||
del aws_config[CONF_PLATFORM]
|
del aws_config[CONF_PLATFORM]
|
||||||
del aws_config[CONF_NAME]
|
del aws_config[CONF_NAME]
|
||||||
|
|
||||||
if aws_config[CONF_PROFILE_NAME]:
|
profile = aws_config.get(CONF_PROFILE_NAME)
|
||||||
boto3.setup_default_session(profile_name=aws_config[CONF_PROFILE_NAME])
|
|
||||||
|
if profile is not None:
|
||||||
|
boto3.setup_default_session(profile_name=profile)
|
||||||
del aws_config[CONF_PROFILE_NAME]
|
del aws_config[CONF_PROFILE_NAME]
|
||||||
|
|
||||||
sns_client = boto3.client("sns", **aws_config)
|
sns_client = boto3.client("sns", **aws_config)
|
||||||
|
|
|
@ -41,8 +41,10 @@ def get_service(hass, config):
|
||||||
del aws_config[CONF_PLATFORM]
|
del aws_config[CONF_PLATFORM]
|
||||||
del aws_config[CONF_NAME]
|
del aws_config[CONF_NAME]
|
||||||
|
|
||||||
if aws_config[CONF_PROFILE_NAME]:
|
profile = aws_config.get(CONF_PROFILE_NAME)
|
||||||
boto3.setup_default_session(profile_name=aws_config[CONF_PROFILE_NAME])
|
|
||||||
|
if profile is not None:
|
||||||
|
boto3.setup_default_session(profile_name=profile)
|
||||||
del aws_config[CONF_PROFILE_NAME]
|
del aws_config[CONF_PROFILE_NAME]
|
||||||
|
|
||||||
sqs_client = boto3.client("sqs", **aws_config)
|
sqs_client = boto3.client("sqs", **aws_config)
|
||||||
|
|
Loading…
Reference in New Issue