diff options
author | Michael Scherer <mscherer@users.noreply.github.com> | 2016-10-15 17:36:44 +0200 |
---|---|---|
committer | Toshio Kuratomi <a.badger@gmail.com> | 2016-10-15 08:36:44 -0700 |
commit | 135e10556472df4be5a0b5473b0d574103783b10 (patch) | |
tree | 0f7fc76e8612c935eb28c7e4fe4b3bfadf228561 /cloud/google | |
parent | e0eb86a5000c1913c8e2925cf2b25a809aab02ef (diff) | |
download | ansible-modules-extras-135e10556472df4be5a0b5473b0d574103783b10.tar.gz |
Fix gce module to compile on python 3 (#3179)
Diffstat (limited to 'cloud/google')
-rw-r--r-- | cloud/google/gce_img.py | 3 | ||||
-rw-r--r-- | cloud/google/gce_tag.py | 3 |
2 files changed, 4 insertions, 2 deletions
diff --git a/cloud/google/gce_img.py b/cloud/google/gce_img.py index 270ae827..031539bf 100644 --- a/cloud/google/gce_img.py +++ b/cloud/google/gce_img.py @@ -166,7 +166,8 @@ def create_image(gce, name, module): return True except ResourceExistsError: return False - except GoogleBaseError, e: + except GoogleBaseError: + e = get_exception() module.fail_json(msg=str(e), changed=False) finally: gce.connection.timeout = old_timeout diff --git a/cloud/google/gce_tag.py b/cloud/google/gce_tag.py index cb1f2a2c..8f280a9e 100644 --- a/cloud/google/gce_tag.py +++ b/cloud/google/gce_tag.py @@ -156,7 +156,8 @@ def remove_tags(gce, module, instance_name, tags): node = gce.ex_get_node(instance_name, zone=zone) except ResourceNotFoundError: module.fail_json(msg='Instance %s not found in zone %s' % (instance_name, zone), changed=False) - except GoogleBaseError, e: + except GoogleBaseError: + e = get_exception() module.fail_json(msg=str(e), changed=False) node_tags = node.extra['tags'] |