Check for AWS keys using boto names

- see https://github.com/boto/boto#getting-started-with-boto
This commit is contained in:
Michael J. Schultz 2013-11-13 16:01:39 -06:00
parent 9e197d3958
commit 5f9485499c

View file

@ -16,6 +16,8 @@ def get_ec2_creds(module):
if not ec2_access_key: if not ec2_access_key:
if 'EC2_ACCESS_KEY' in os.environ: if 'EC2_ACCESS_KEY' in os.environ:
ec2_access_key = os.environ['EC2_ACCESS_KEY'] ec2_access_key = os.environ['EC2_ACCESS_KEY']
elif 'AWS_ACCESS_KEY_ID' in os.environ:
ec2_access_key = os.environ['AWS_ACCESS_KEY_ID']
elif 'AWS_ACCESS_KEY' in os.environ: elif 'AWS_ACCESS_KEY' in os.environ:
ec2_access_key = os.environ['AWS_ACCESS_KEY'] ec2_access_key = os.environ['AWS_ACCESS_KEY']
else: else:
@ -24,6 +26,8 @@ def get_ec2_creds(module):
if not ec2_secret_key: if not ec2_secret_key:
if 'EC2_SECRET_KEY' in os.environ: if 'EC2_SECRET_KEY' in os.environ:
ec2_secret_key = os.environ['EC2_SECRET_KEY'] ec2_secret_key = os.environ['EC2_SECRET_KEY']
elif 'AWS_SECRET_ACCESS_KEY' in os.environ:
ec2_secret_key = os.environ['AWS_SECRET_ACCESS_KEY']
elif 'AWS_SECRET_KEY' in os.environ: elif 'AWS_SECRET_KEY' in os.environ:
ec2_secret_key = os.environ['AWS_SECRET_KEY'] ec2_secret_key = os.environ['AWS_SECRET_KEY']
else: else: