mirror of
https://github.com/ansible-collections/community.general.git
synced 2026-05-08 22:33:25 +00: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:
@@ -122,7 +122,7 @@ def main():
|
||||
endpoint = "elasticache.%s.amazonaws.com" % region
|
||||
connect_region = RegionInfo(name=region, endpoint=endpoint)
|
||||
conn = ElastiCacheConnection(region=connect_region, **aws_connect_kwargs)
|
||||
except boto.exception.NoAuthHandlerFound, e:
|
||||
except boto.exception.NoAuthHandlerFound as e:
|
||||
module.fail_json(msg=e.message)
|
||||
|
||||
try:
|
||||
@@ -132,7 +132,7 @@ def main():
|
||||
try:
|
||||
matching_groups = conn.describe_cache_subnet_groups(group_name, max_records=100)
|
||||
exists = len(matching_groups) > 0
|
||||
except BotoServerError, e:
|
||||
except BotoServerError as e:
|
||||
if e.error_code != 'CacheSubnetGroupNotFoundFault':
|
||||
module.fail_json(msg = e.error_message)
|
||||
|
||||
@@ -148,7 +148,7 @@ def main():
|
||||
changed_group = conn.modify_cache_subnet_group(group_name, cache_subnet_group_description=group_description, subnet_ids=group_subnets)
|
||||
changed = True
|
||||
|
||||
except BotoServerError, e:
|
||||
except BotoServerError as e:
|
||||
if e.error_message != 'No modifications were requested.':
|
||||
module.fail_json(msg = e.error_message)
|
||||
else:
|
||||
|
||||
Reference in New Issue
Block a user