From 8c46b5c955e128e8049ce578d2101327a9c0a37f Mon Sep 17 00:00:00 2001 From: Cédric Jeanneret Date: Thu, 5 Nov 2015 08:56:45 +0100 Subject: Do not add blindy the semi-colon --- templates/subnet.conf.erb | 16 ++++++++++++---- 1 file 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 -%> } -- cgit v1.2.3