summaryrefslogtreecommitdiff
path: root/templates
diff options
context:
space:
mode:
authorR. Tyler Croy <tyler@monkeypox.org>2012-07-08 21:33:13 -0700
committerR. Tyler Croy <tyler@monkeypox.org>2012-07-08 21:38:49 -0700
commitf9e56b6d4308da2b298b6b616313ecc553a5b6dc (patch)
treeef4d3c6f012b5adcfc6b35364d06c370ccf95170 /templates
parenteb482ec09f20a6d3a1ec6539bf65167478284a04 (diff)
Properly handle both Arrays and Strings passed as balancer member options
The template cannot rely on deprecated functionality of the String class (`#each` which disappears in 1.9) Fixes #9
Diffstat (limited to 'templates')
-rw-r--r--templates/haproxy_balancermember.erb5
1 files changed, 4 insertions, 1 deletions
diff --git a/templates/haproxy_balancermember.erb b/templates/haproxy_balancermember.erb
index b739e11..f85137d 100644
--- a/templates/haproxy_balancermember.erb
+++ b/templates/haproxy_balancermember.erb
@@ -1 +1,4 @@
- server <%= server_name %> <%= balancer_ip %>:<%= balancer_port %> <% balancermember_options.each do |item| %> <%= item %> <% end %>
+ server <%= server_name %> <%= balancer_ip %>:<%= balancer_port %> <%
+ items = balancermember_options
+ items = [items] unless balancermember_options.instance_of? Array
+ items.each do |item| %> <%= item %><% end %>