aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCédric Jeanneret <cedric.jeanneret@camptocamp.com>2015-11-05 08:56:45 +0100
committerCédric Jeanneret <cedric.jeanneret@camptocamp.com>2015-11-06 08:43:31 +0100
commit8c46b5c955e128e8049ce578d2101327a9c0a37f (patch)
tree275c580eec7c7479f47c9b5695f90a381385650c
parent24d4dfa1c2256db068b51115828bbc12e247d7f2 (diff)
downloadpuppet-dhcp-8c46b5c955e128e8049ce578d2101327a9c0a37f.tar.gz
puppet-dhcp-8c46b5c955e128e8049ce578d2101327a9c0a37f.tar.bz2
Do not add blindy the semi-colon
-rw-r--r--templates/subnet.conf.erb16
1 files changed, 12 insertions, 4 deletions
diff --git a/templates/subnet.conf.erb b/templates/subnet.conf.erb
index 11f9ed4..9592a4c 100644
--- a/templates/subnet.conf.erb
+++ b/templates/subnet.conf.erb
@@ -19,10 +19,18 @@ subnet <%= @name %> netmask <%= _netmask %> {
scope.function_validate_re([_domain_name, '^\S+$']) -%>
option domain-name "<%= _domain_name %>";
<% unless @other_opts.empty? -%>
- <% if @other_opts.is_a?(Array) -%>
-<%= @other_opts.collect! {|i| " #{i};"}.join("\n") %>
- <% else -%>
+<%
+if @other_opts.is_a?(Array)
+ @other_opts.each do |i|
+ if i =~ /(\{|\})/
+-%>
+ <%= i %>
+<%- else -%>
+ <%= i %>;
+<% end -%>
+<% end -%>
+<% else -%>
<%= @other_opts %>;
- <% end -%>
+<% end -%>
<% end -%>
}