From 6443a56069fdbd51b91405d4e45f13f0aa44546c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ren=C3=A9=20Moser?= Date: Fri, 25 May 2018 10:24:39 +0200 Subject: [PATCH] cloudstack: vpn: compatiblity fix for 4.5 API (#40700) --- lib/ansible/modules/cloud/cloudstack/cs_vpn_connection.py | 2 +- lib/ansible/modules/cloud/cloudstack/cs_vpn_customer_gateway.py | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/ansible/modules/cloud/cloudstack/cs_vpn_connection.py b/lib/ansible/modules/cloud/cloudstack/cs_vpn_connection.py index eb12750ba21..6db5b3bda17 100644 --- a/lib/ansible/modules/cloud/cloudstack/cs_vpn_connection.py +++ b/lib/ansible/modules/cloud/cloudstack/cs_vpn_connection.py @@ -297,7 +297,7 @@ class AnsibleCloudStackVpnConnection(AnsibleCloudStack): if 'cidrlist' in vpn_conn: self.result['cidrs'] = vpn_conn['cidrlist'].split(',') or [vpn_conn['cidrlist']] # Ensure we return a bool - self.result['force_encap'] = True if vpn_conn['forceencap'] else False + self.result['force_encap'] = True if vpn_conn.get('forceencap') else False args = { 'key': 'name', 'identifier': vpn_conn['s2scustomergatewayid'], diff --git a/lib/ansible/modules/cloud/cloudstack/cs_vpn_customer_gateway.py b/lib/ansible/modules/cloud/cloudstack/cs_vpn_customer_gateway.py index 5063be3c198..f94fb2be89f 100644 --- a/lib/ansible/modules/cloud/cloudstack/cs_vpn_customer_gateway.py +++ b/lib/ansible/modules/cloud/cloudstack/cs_vpn_customer_gateway.py @@ -289,7 +289,7 @@ class AnsibleCloudStackVpnCustomerGateway(AnsibleCloudStack): if 'cidrlist' in vpn_customer_gateway: self.result['cidrs'] = vpn_customer_gateway['cidrlist'].split(',') or [vpn_customer_gateway['cidrlist']] # Ensure we return a bool - self.result['force_encap'] = True if vpn_customer_gateway['forceencap'] else False + self.result['force_encap'] = True if vpn_customer_gateway.get('forceencap') else False return self.result