From 2250a956384c09f3d5efaa8dbf4c719590eecc0f Mon Sep 17 00:00:00 2001 From: Dan Abel Date: Fri, 31 Oct 2014 14:13:08 +0000 Subject: [PATCH] use simpler ec2_connect ec2 util call This allows boto profile use --- lib/ansible/modules/cloud/amazon/ec2_vpc.py | 15 +-------------- 1 file changed, 1 insertion(+), 14 deletions(-) diff --git a/lib/ansible/modules/cloud/amazon/ec2_vpc.py b/lib/ansible/modules/cloud/amazon/ec2_vpc.py index a4f7c0ade43..486cd0d38a9 100644 --- a/lib/ansible/modules/cloud/amazon/ec2_vpc.py +++ b/lib/ansible/modules/cloud/amazon/ec2_vpc.py @@ -599,20 +599,7 @@ def main(): state = module.params.get('state') - ec2_url, aws_access_key, aws_secret_key, region = get_ec2_creds(module) - - # If we have a region specified, connect to its endpoint. - if region: - try: - vpc_conn = boto.vpc.connect_to_region( - region, - aws_access_key_id=aws_access_key, - aws_secret_access_key=aws_secret_key - ) - except boto.exception.NoAuthHandlerFound, e: - module.fail_json(msg = str(e)) - else: - module.fail_json(msg="region must be specified") + vpc_conn = ec2_connect(module) if module.params.get('state') == 'absent': vpc_id = module.params.get('vpc_id')