From 5591e6bb0b5c0f8cd6d066372fcdce9666e8695b Mon Sep 17 00:00:00 2001 From: John Baublitz Date: Tue, 24 May 2016 19:20:43 +0000 Subject: [PATCH] Add error handling for specifying 'mode' with insufficiently recent libcloud --- lib/ansible/modules/cloud/google/gce_net.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/lib/ansible/modules/cloud/google/gce_net.py b/lib/ansible/modules/cloud/google/gce_net.py index 368f42ced6d..c1e9616b615 100644 --- a/lib/ansible/modules/cloud/google/gce_net.py +++ b/lib/ansible/modules/cloud/google/gce_net.py @@ -253,6 +253,8 @@ def main(): json_output['name'] = name json_output['ipv4_range'] = ipv4_range changed = True + except TypeError: + module.fail_json(msg="Update libcloud to a more recent version (1.0+) that supports network 'mode' parameter", changed=False) except Exception as e: module.fail_json(msg=unexpected_error_msg(e), changed=False)