From c8dc0bf5c99b24b230f18505bfb2d2f6c1ed6609 Mon Sep 17 00:00:00 2001 From: John Baublitz Date: Fri, 3 Jun 2016 15:54:48 +0000 Subject: [PATCH] Fix exception handling to be compatible with Python 3 --- lib/ansible/modules/cloud/google/gce_net.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/lib/ansible/modules/cloud/google/gce_net.py b/lib/ansible/modules/cloud/google/gce_net.py index 5c7a35c21a9..9b352af7608 100644 --- a/lib/ansible/modules/cloud/google/gce_net.py +++ b/lib/ansible/modules/cloud/google/gce_net.py @@ -305,7 +305,7 @@ def main(): json_output['subnet_name'] = subnet_name json_output['ipv4_range'] = ipv4_range changed = True - except Exception, e: + except Exception as e: module.fail_json(msg=unexpected_error_msg(e), changed=changed) if fwname: @@ -411,7 +411,7 @@ def main(): subnet = gce.ex_get_subnetwork(subnet_name, region=subnet_region) except ResourceNotFoundError: pass - except Exception, e: + except Exception as e: module.fail_json(msg=unexpected_error_msg(e), changed=False) if subnet: gce.ex_destroy_subnetwork(subnet) @@ -430,7 +430,7 @@ def main(): # json_output['d4'] = 'deleting %s' % name try: gce.ex_destroy_network(network) - except Exception, e: + except Exception as e: module.fail_json(msg=unexpected_error_msg(e), changed=False) # json_output['d5'] = 'deleted %s' % name changed = True