From 785bc93ff752010e2fa73102492af9047ff325a6 Mon Sep 17 00:00:00 2001 From: Matt Clay Date: Wed, 3 May 2017 09:59:05 +0800 Subject: [PATCH] Allow empty string for EC2 session token from env. --- lib/ansible/module_utils/ec2.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/lib/ansible/module_utils/ec2.py b/lib/ansible/module_utils/ec2.py index 52c2df052d..b9383adc0e 100644 --- a/lib/ansible/module_utils/ec2.py +++ b/lib/ansible/module_utils/ec2.py @@ -208,7 +208,8 @@ def get_aws_connection_info(module, boto3=False): security_token = os.environ['AWS_SESSION_TOKEN'] elif 'EC2_SECURITY_TOKEN' in os.environ: security_token = os.environ['EC2_SECURITY_TOKEN'] - else: + + if not security_token: # in case security_token came in as empty string security_token = None