diff options
author | Ryan Brown <sb@ryansb.com> | 2016-09-16 15:46:41 -0400 |
---|---|---|
committer | Brian Coca <bcoca@users.noreply.github.com> | 2016-09-16 15:46:41 -0400 |
commit | 2be52280fc1d3225c0874d4c6963d758078ce79f (patch) | |
tree | 3f8db6b0ccd314334f65ae95a916ac6be0de8289 /cloud/amazon | |
parent | abc1a988265ec59be5a9dac487c1fe0af6f801cf (diff) | |
download | ansible-modules-extras-2be52280fc1d3225c0874d4c6963d758078ce79f.tar.gz |
Fix exception syntax for Python 3.x (#2940)
since boto already precludes python2.4, no need to use a common 2.4/3 syntax
Diffstat (limited to 'cloud/amazon')
-rw-r--r-- | cloud/amazon/cloudwatchevent_rule.py | 6 | ||||
-rw-r--r-- | cloud/amazon/redshift_subnet_group.py | 8 |
2 files changed, 7 insertions, 7 deletions
diff --git a/cloud/amazon/cloudwatchevent_rule.py b/cloud/amazon/cloudwatchevent_rule.py index a21800c1..8fda1c12 100644 --- a/cloud/amazon/cloudwatchevent_rule.py +++ b/cloud/amazon/cloudwatchevent_rule.py @@ -128,7 +128,7 @@ class CloudWatchEventRule(object): """Returns the existing details of the rule in AWS""" try: rule_info = self.client.describe_rule(Name=self.name) - except botocore.exceptions.ClientError, e: + except botocore.exceptions.ClientError as e: error_code = e.response.get('Error', {}).get('Code') if error_code == 'ResourceNotFoundException': return {} @@ -176,7 +176,7 @@ class CloudWatchEventRule(object): """Lists the existing targets for the rule in AWS""" try: targets = self.client.list_targets_by_rule(Rule=self.name) - except botocore.exceptions.ClientError, e: + except botocore.exceptions.ClientError as e: error_code = e.response.get('Error', {}).get('Code') if error_code == 'ResourceNotFoundException': return [] @@ -356,7 +356,7 @@ def get_cloudwatchevents_client(module): resource='events', region=region, endpoint=ec2_url, **aws_conn_kwargs) - except boto3.exception.NoAuthHandlerFound, e: + except boto3.exception.NoAuthHandlerFound as e: module.fail_json(msg=str(e)) diff --git a/cloud/amazon/redshift_subnet_group.py b/cloud/amazon/redshift_subnet_group.py index acd3330c..d47593c7 100644 --- a/cloud/amazon/redshift_subnet_group.py +++ b/cloud/amazon/redshift_subnet_group.py @@ -17,7 +17,7 @@ DOCUMENTATION = ''' --- -author: +author: - "Jens Carl (@j-carl), Hothead Games Inc." module: redshift_subnet_group version_added: "2.1" @@ -128,7 +128,7 @@ def main(): # Connect to the Redshift endpoint. try: conn = connect_to_aws(boto.redshift, region, **aws_connect_params) - except boto.exception.JSONResponseError, e: + except boto.exception.JSONResponseError as e: module.fail_json(msg=str(e)) try: @@ -139,7 +139,7 @@ def main(): try: matching_groups = conn.describe_cluster_subnet_groups(group_name, max_records=100) exists = len(matching_groups) > 0 - except boto.exception.JSONResponseError, e: + except boto.exception.JSONResponseError as e: if e.body['Error']['Code'] != 'ClusterSubnetGroupNotFoundFault': #if e.code != 'ClusterSubnetGroupNotFoundFault': module.fail_json(msg=str(e)) @@ -169,7 +169,7 @@ def main(): changed = True - except boto.exception.JSONResponseError, e: + except boto.exception.JSONResponseError as e: module.fail_json(msg=str(e)) module.exit_json(changed=changed, group=group) |