mirror of
https://github.com/ansible-collections/community.general.git
synced 2025-07-24 13:50:22 -07:00
Fixing error exception handling for python3. Does not need to be compa… (#3840)
* Fixing error exception handling for python. Does not need to be compatible with Python2.4 b/c boto is Python 2.6 and above. * Fixing error exception handling for python. Does not need to be compatible with Python2.4 b/c boto is Python 2.6 and above. * Fixing compile time errors IRT error exception handling for Python 3.5. This does not need to be compatible with Python2.4 b/c Boto is Python 2.6 and above.
This commit is contained in:
parent
1573066ec1
commit
3fa745eef9
24 changed files with 173 additions and 173 deletions
|
@ -117,7 +117,7 @@ def main():
|
|||
|
||||
try:
|
||||
conn = connect_to_aws(boto.rds, region, **aws_connect_kwargs)
|
||||
except boto.exception.BotoServerError, e:
|
||||
except boto.exception.BotoServerError as e:
|
||||
module.fail_json(msg = e.error_message)
|
||||
|
||||
try:
|
||||
|
@ -127,7 +127,7 @@ def main():
|
|||
try:
|
||||
matching_groups = conn.get_all_db_subnet_groups(group_name, max_records=100)
|
||||
exists = len(matching_groups) > 0
|
||||
except BotoServerError, e:
|
||||
except BotoServerError as e:
|
||||
if e.error_code != 'DBSubnetGroupNotFoundFault':
|
||||
module.fail_json(msg = e.error_message)
|
||||
|
||||
|
@ -146,7 +146,7 @@ def main():
|
|||
if ( (matching_groups[0].name != group_name) or (matching_groups[0].description != group_description) or (matching_groups[0].subnet_ids != group_subnets) ):
|
||||
changed_group = conn.modify_db_subnet_group(group_name, description=group_description, subnet_ids=group_subnets)
|
||||
changed = True
|
||||
except BotoServerError, e:
|
||||
except BotoServerError as e:
|
||||
module.fail_json(msg = e.error_message)
|
||||
|
||||
module.exit_json(changed=changed)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue