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

@ -60,6 +60,12 @@ try:
except ImportError:
HAS_BOTO3 = False
from ansible.module_utils.basic import AnsibleModule
from ansible.module_utils.ec2 import (AnsibleAWSError,
ansible_dict_to_boto3_filter_list, boto3_conn,
boto3_tag_list_to_ansible_dict, camel_dict_to_snake_dict,
connect_to_aws, ec2_argument_spec, get_aws_connection_info)
def list_ec2_snapshots_boto3(connection, module):
@ -172,15 +178,13 @@ def main():
if region:
try:
connection = connect_to_aws(boto.ec2, region, **aws_connect_params)
except (boto.exception.NoAuthHandlerFound, AnsibleAWSError), e:
except (boto.exception.NoAuthHandlerFound, AnsibleAWSError) as e:
module.fail_json(msg=str(e))
else:
module.fail_json(msg="region must be specified")
list_eni(connection, module)
from ansible.module_utils.basic import *
from ansible.module_utils.ec2 import *
if __name__ == '__main__':
main()