ansible/ansible — pull request #4787 by mohangk (2013-11-02 22:22:40+00:00)
Title: Fix: ec2_eip connect method references module var that is not passed in

The connect method assumes that it has access to the module var although its not passed in. This results in an error that looks like the following when there is an exception thrown in the method, masking the actual error message.

fatal: [x.x.x.x] => failed to parse: Traceback (most recent call last):
File "/home/ubuntu/.ansible/tmp/ansible-1383430459.64-34518968398797/ec2_eip", line 1346, in
main()
File "/home/ubuntu/.ansible/tmp/ansible-1383430459.64-34518968398797/ec2_eip", line 268, in main
region=region)
File "/home/ubuntu/.ansible/tmp/ansible-1383430459.64-34518968398797/ec2_eip", line 132, in connect
module.fail_json(msg = str(e))
NameError: global name 'module' is not defined

This diff fixes it by ensuring that connect call passes the module as well.