From 0ae9128c7b6d21a25f4b698dacd071bde8fb68f9 Mon Sep 17 00:00:00 2001 From: Mohan Krishnan Date: Sun, 3 Nov 2013 05:18:27 +0700 Subject: [PATCH] ec2_eip connect method references module var that is not passed in --- library/cloud/ec2_eip | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-) diff --git a/library/cloud/ec2_eip b/library/cloud/ec2_eip index 4bd3c1b8ad..e34c89ef18 100644 --- a/library/cloud/ec2_eip +++ b/library/cloud/ec2_eip @@ -102,7 +102,7 @@ else: boto_found = True -def connect(ec2_url, ec2_secret_key, ec2_access_key, region): +def connect(ec2_url, ec2_secret_key, ec2_access_key, region, module): """ Return an ec2 connection""" # allow environment variables to be used if ansible vars aren't set if not ec2_url and 'EC2_URL' in os.environ: @@ -258,14 +258,13 @@ def main(): if not boto_found: module.fail_json(msg="boto is required") - # def get_ec2_creds(module): - # return ec2_url, ec2_access_key, ec2_secret_key, region ec2_url, ec2_access_key, ec2_secret_key, region = get_ec2_creds(module) - ec2 = connect(ec2_url=ec2_url, - ec2_access_key=ec2_access_key, - ec2_secret_key=ec2_secret_key, - region=region) + ec2 = connect(ec2_url, + ec2_access_key, + ec2_secret_key, + region, + module) instance_id = module.params.get('instance_id') public_ip = module.params.get('public_ip')