summaryrefslogtreecommitdiff
path: root/provider_base/files/service-definitions
diff options
context:
space:
mode:
authorelijah <elijah@riseup.net>2014-11-24 12:11:32 -0800
committerelijah <elijah@riseup.net>2014-11-24 12:28:47 -0800
commit95d30570f681ba2f43bbe7ffe344b92439be1ae9 (patch)
treefb7a42d15f3f42a74bda104e60f9e06dddcc9846 /provider_base/files/service-definitions
parent9da4a1e64b1a0238dbf25f153112093232a960bb (diff)
fixed bug when there is no vpn service
Diffstat (limited to 'provider_base/files/service-definitions')
-rw-r--r--provider_base/files/service-definitions/v1/eip-service.json.erb14
1 files changed, 8 insertions, 6 deletions
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