mirror of
https://github.com/ansible-collections/community.general.git
synced 2025-07-23 05:10:22 -07:00
Fix amazon extras modules to compile under python3
This commit is contained in:
parent
46a1f73778
commit
3901fe72d3
31 changed files with 192 additions and 190 deletions
|
@ -73,7 +73,6 @@ EXAMPLES = '''
|
|||
|
||||
'''
|
||||
|
||||
import sys # noqa
|
||||
import time
|
||||
|
||||
try:
|
||||
|
@ -86,6 +85,9 @@ except ImportError:
|
|||
if __name__ != '__main__':
|
||||
raise
|
||||
|
||||
from ansible.module_utils.basic import AnsibleModule
|
||||
from ansible.module_utils.ec2 import AnsibleAWSError, connect_to_aws, ec2_argument_spec, get_aws_connection_info
|
||||
|
||||
|
||||
class AnsibleVPCSubnetException(Exception):
|
||||
pass
|
||||
|
@ -252,7 +254,7 @@ def main():
|
|||
if region:
|
||||
try:
|
||||
connection = connect_to_aws(boto.vpc, 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")
|
||||
|
@ -275,8 +277,6 @@ def main():
|
|||
|
||||
module.exit_json(**result)
|
||||
|
||||
from ansible.module_utils.basic import * # noqa
|
||||
from ansible.module_utils.ec2 import * # noqa
|
||||
|
||||
if __name__ == '__main__':
|
||||
main()
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue