mirror of
https://github.com/ansible-collections/community.general.git
synced 2026-05-08 06:12:51 +00:00
Remove redundant credential code in vpc module
This commit is contained in:
@@ -498,24 +498,6 @@ def main():
|
|||||||
|
|
||||||
ec2_url, aws_access_key, aws_secret_key, region = get_ec2_creds(module)
|
ec2_url, aws_access_key, aws_secret_key, region = get_ec2_creds(module)
|
||||||
|
|
||||||
if not aws_secret_key:
|
|
||||||
if 'AWS_SECRET_KEY' in os.environ:
|
|
||||||
aws_secret_key = os.environ['AWS_SECRET_KEY']
|
|
||||||
elif 'EC2_SECRET_KEY' in os.environ:
|
|
||||||
aws_secret_key = os.environ['EC2_SECRET_KEY']
|
|
||||||
|
|
||||||
if not aws_access_key:
|
|
||||||
if 'AWS_ACCESS_KEY' in os.environ:
|
|
||||||
aws_access_key = os.environ['AWS_ACCESS_KEY']
|
|
||||||
elif 'EC2_ACCESS_KEY' in os.environ:
|
|
||||||
aws_access_key = os.environ['EC2_ACCESS_KEY']
|
|
||||||
|
|
||||||
if not region:
|
|
||||||
if 'AWS_REGION' in os.environ:
|
|
||||||
region = os.environ['AWS_REGION']
|
|
||||||
elif 'EC2_REGION' in os.environ:
|
|
||||||
region = os.environ['EC2_REGION']
|
|
||||||
|
|
||||||
# If we have a region specified, connect to its endpoint.
|
# If we have a region specified, connect to its endpoint.
|
||||||
if region:
|
if region:
|
||||||
try:
|
try:
|
||||||
|
|||||||
Reference in New Issue
Block a user