From 8ef18e6aa0e29f39d073aaa60b007d5c8988b901 Mon Sep 17 00:00:00 2001 From: txaj Date: Thu, 11 Dec 2014 00:06:05 -0700 Subject: [PATCH] Ensure variable using 'false' will be interpreted. --- templates/plugin/apache.conf.erb | 4 ++-- templates/plugin/bind.conf.erb | 6 +++--- templates/plugin/match.tpl.erb | 2 +- templates/plugin/network.conf.erb | 4 ++-- templates/plugin/nginx.conf.erb | 4 ++-- templates/plugin/postgresql/writer.conf.erb | 2 +- templates/plugin/rrdcached.conf.erb | 4 ++-- templates/plugin/sensors.conf.erb | 2 +- templates/plugin/statsd.conf.erb | 8 ++++---- templates/plugin/write_http.conf.erb | 4 ++-- 10 files changed, 20 insertions(+), 20 deletions(-) diff --git a/templates/plugin/apache.conf.erb b/templates/plugin/apache.conf.erb index e293fcd0e..d4231363a 100644 --- a/templates/plugin/apache.conf.erb +++ b/templates/plugin/apache.conf.erb @@ -8,10 +8,10 @@ <% if values['password'] -%> Password "<%= values['password'] %>" <% end -%> -<% if values['verifypeer'] -%> +<% unless values['verifypeer'].nil? -%> VerifyPeer "<%= values['verifypeer'] %>" <% end -%> -<% if values['verifyhost'] -%> +<% unless values['verifyhost'].nil? -%> VerifyHost "<%= values['verifyhost'] %>" <% end -%> <% if values['cacert'] -%> diff --git a/templates/plugin/bind.conf.erb b/templates/plugin/bind.conf.erb index ebc6ef663..877257c2e 100644 --- a/templates/plugin/bind.conf.erb +++ b/templates/plugin/bind.conf.erb @@ -9,13 +9,13 @@ MemoryStats <%= @memorystats %> <% @views.each do |view| -%> "> -<% if view['qtypes'] -%> +<% unless view['qtypes'].nil? -%> QTypes <%= view['qtypes'] %> <% end -%> -<% if view['resolverstats'] -%> +<% unless view['resolverstats'].nil? -%> ResolverStats <%= view['resolverstats'] %> <% end -%> -<% if view['cacherrsets'] -%> +<% unless view['cacherrsets'].nil? -%> CacheRRSets <%= view['cacherrsets'] %> <% end -%> <% if view['zones'] -%> diff --git a/templates/plugin/match.tpl.erb b/templates/plugin/match.tpl.erb index 68e67945b..7bbddc483 100644 --- a/templates/plugin/match.tpl.erb +++ b/templates/plugin/match.tpl.erb @@ -1,7 +1,7 @@ <% @matches.each do |match| -%> Regex "<%= match['regex'] %>" -<% if match['excluderegex'] -%> +<% unless match['excluderegex'].nil? -%> ExcludeRegex "<%= match['excluderegex'] %>" <% end -%> DSType "<%= match['dstype'] %>" diff --git a/templates/plugin/network.conf.erb b/templates/plugin/network.conf.erb index b092d6c2f..f7439b84f 100644 --- a/templates/plugin/network.conf.erb +++ b/templates/plugin/network.conf.erb @@ -5,10 +5,10 @@ <% if @maxpacketsize -%> MaxPacketSize <%= @maxpacketsize %> <% end -%> -<% if @forward -%> +<% unless @forward.nil? -%> Forward "<%= @forward %>" <% end -%> -<% if @reportstats -%> +<% unless @reportstats.nil? -%> ReportStats "<%= @reportstats %>" <% end -%> diff --git a/templates/plugin/nginx.conf.erb b/templates/plugin/nginx.conf.erb index 076173e05..66e90ea27 100644 --- a/templates/plugin/nginx.conf.erb +++ b/templates/plugin/nginx.conf.erb @@ -6,10 +6,10 @@ <% if @password -%> Password "<%= @password %>" <% end -%> -<% if @verifypeer -%> +<% unless @verifypeer.nil? -%> VerifyPeer <%= @verifypeer %> <% end -%> -<% if @verifyhost -%> +<% unless @verifyhost.nil? -%> VerifyHost <%= @verifyhost %> <% end -%> <% if @cacert -%> diff --git a/templates/plugin/postgresql/writer.conf.erb b/templates/plugin/postgresql/writer.conf.erb index 0de197908..1c6dbe857 100644 --- a/templates/plugin/postgresql/writer.conf.erb +++ b/templates/plugin/postgresql/writer.conf.erb @@ -1,6 +1,6 @@ > Statement "<%= @statement %>" -<% if @storerates -%> +<% unless @storerates.nil? -%> StoreRates <%= @storerates %> <% end -%> diff --git a/templates/plugin/rrdcached.conf.erb b/templates/plugin/rrdcached.conf.erb index dec0febef..0f7018c23 100644 --- a/templates/plugin/rrdcached.conf.erb +++ b/templates/plugin/rrdcached.conf.erb @@ -1,10 +1,10 @@ DaemonAddress "<%= @daemonaddress %>" DataDir "<%= @datadir %>" -<% unless @createfiles -%> +<% unless @createfiles.nil? -%> CreateFiles "<%= @createfiles %>" <% end -%> -<% if @createfilesasync -%> +<% unless @createfilesasync.nil? -%> CreateFilesAsync "<%= @createfilesasync %>" <% end -%> <% if @stepsize -%> diff --git a/templates/plugin/sensors.conf.erb b/templates/plugin/sensors.conf.erb index fa6392900..6a7dacc8a 100644 --- a/templates/plugin/sensors.conf.erb +++ b/templates/plugin/sensors.conf.erb @@ -7,7 +7,7 @@ Sensor "<%= @sensor %>" <% end -%> <% end -%> -<% if @ignoreselected -%> +<% unless @ignoreselected.nil? -%> IgnoreSelected "<%= @ignoreselected %>" <% end -%> diff --git a/templates/plugin/statsd.conf.erb b/templates/plugin/statsd.conf.erb index acd5cd82a..c821eff41 100644 --- a/templates/plugin/statsd.conf.erb +++ b/templates/plugin/statsd.conf.erb @@ -5,16 +5,16 @@ <% if @port -%> Port <%= @port %> <% end -%> -<% if @deletecounters -%> +<% unless @deletecounters.nil? -%> DeleteCounters <%= @deletecounters %> <% end -%> -<% if @deletetimers -%> +<% unless @deletetimers.nil? -%> DeleteTimers <%= @deletetimers %> <% end -%> -<% if @deletegauges -%> +<% unless @deletegauges.nil? -%> DeleteGauges <%= @deletegauges %> <% end -%> -<% if @deletesets -%> +<% unless @deletesets.nil? -%> Deletesets <%= @deletesets %> <% end -%> <% if @timerpercentile -%> diff --git a/templates/plugin/write_http.conf.erb b/templates/plugin/write_http.conf.erb index 4554d6c86..281698989 100644 --- a/templates/plugin/write_http.conf.erb +++ b/templates/plugin/write_http.conf.erb @@ -7,10 +7,10 @@ <% if values['password'] -%> Password "<%= values['password'] %>" <% end -%> -<% if values['verifypeer'] -%> +<% unless values['verifypeer'].nil? -%> VerifyPeer "<%= values['verifypeer'] %>" <% end -%> -<% if values['verifyhost'] -%> +<% unless values['verifyhost'].nil? -%> VerifyHost "<%= values['verifyhost'] %>" <% end -%> <% if values['cacert'] -%>