Fix amazon extras modules to compile under python3

This commit is contained in:
Toshio Kuratomi 2016-10-23 13:41:03 -07:00 committed by Matt Clay
commit 3901fe72d3
31 changed files with 192 additions and 190 deletions

View file

@ -106,8 +106,6 @@ zone_id:
sample: "Z6JQG9820BEFMW"
'''
import time
try:
import boto
import boto.ec2
@ -118,6 +116,9 @@ try:
except ImportError:
HAS_BOTO = False
from ansible.module_utils.basic import AnsibleModule
from ansible.module_utils.ec2 import ec2_argument_spec, get_aws_connection_info
def main():
argument_spec = ec2_argument_spec()
@ -148,7 +149,7 @@ def main():
# connect to the route53 endpoint
try:
conn = Route53Connection(**aws_connect_kwargs)
except boto.exception.BotoServerError, e:
except boto.exception.BotoServerError as e:
module.fail_json(msg=e.error_message)
results = conn.get_all_hosted_zones()
@ -216,7 +217,5 @@ def main():
elif state == 'absent':
module.exit_json(changed=False)
from ansible.module_utils.basic import *
from ansible.module_utils.ec2 import *
main()
if __name__ == '__main__':
main()