From 95d30570f681ba2f43bbe7ffe344b92439be1ae9 Mon Sep 17 00:00:00 2001 From: elijah Date: Mon, 24 Nov 2014 12:11:32 -0800 Subject: fixed bug when there is no vpn service --- .../files/service-definitions/v1/eip-service.json.erb | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) (limited to 'provider_base/files/service-definitions') diff --git a/provider_base/files/service-definitions/v1/eip-service.json.erb b/provider_base/files/service-definitions/v1/eip-service.json.erb index 0ecd002a..4bd220df 100644 --- a/provider_base/files/service-definitions/v1/eip-service.json.erb +++ b/provider_base/files/service-definitions/v1/eip-service.json.erb @@ -42,12 +42,14 @@ end configuration = node.openvpn.configuration end - configuration = configuration.dup - if configuration['fragment'] && configuration['fragment'] == 1500 - configuration.delete('fragment') + if gateways.any? + configuration = configuration.dup + if configuration['fragment'] && configuration['fragment'] == 1500 + configuration.delete('fragment') + end + hsh["gateways"] = gateways.compact + hsh["locations"] = locations + hsh["openvpn_configuration"] = configuration end - hsh["gateways"] = gateways.compact - hsh["locations"] = locations - hsh["openvpn_configuration"] = configuration JSON.sorted_generate hsh %> \ No newline at end of file -- cgit v1.2.3