Fix profile usage with aws notify platforms (#2100)

pull/2101/head
Robbie Trencheny 2016-05-17 16:51:38 -07:00
parent a565cc4b73
commit c96a5d5b2b
3 changed files with 12 additions and 6 deletions

View File

@ -50,8 +50,10 @@ def get_service(hass, config):
del aws_config[CONF_NAME]
del aws_config[CONF_CONTEXT]
if aws_config[CONF_PROFILE_NAME]:
boto3.setup_default_session(profile_name=aws_config[CONF_PROFILE_NAME])
profile = aws_config.get(CONF_PROFILE_NAME)
if profile is not None:
boto3.setup_default_session(profile_name=profile)
del aws_config[CONF_PROFILE_NAME]
lambda_client = boto3.client("lambda", **aws_config)

View File

@ -41,8 +41,10 @@ def get_service(hass, config):
del aws_config[CONF_PLATFORM]
del aws_config[CONF_NAME]
if aws_config[CONF_PROFILE_NAME]:
boto3.setup_default_session(profile_name=aws_config[CONF_PROFILE_NAME])
profile = aws_config.get(CONF_PROFILE_NAME)
if profile is not None:
boto3.setup_default_session(profile_name=profile)
del aws_config[CONF_PROFILE_NAME]
sns_client = boto3.client("sns", **aws_config)

View File

@ -41,8 +41,10 @@ def get_service(hass, config):
del aws_config[CONF_PLATFORM]
del aws_config[CONF_NAME]
if aws_config[CONF_PROFILE_NAME]:
boto3.setup_default_session(profile_name=aws_config[CONF_PROFILE_NAME])
profile = aws_config.get(CONF_PROFILE_NAME)
if profile is not None:
boto3.setup_default_session(profile_name=profile)
del aws_config[CONF_PROFILE_NAME]
sqs_client = boto3.client("sqs", **aws_config)