Use %> instead of -%> at the end of some ERB tags so that trailing whitespace isn't surpressed. Surpressing the trailing whitespace caused problems where there was one more parameters listed after each other. Each parameter would get squashed onto a single line, causing a syntax error when Icinga2 parsed the object file.

refs#7715: https://dev.icinga.org/issues/7715
This commit is contained in:
Nick Chappell 2014-11-18 22:16:42 -08:00
parent 299005edf4
commit 633e4faef9
11 changed files with 45 additions and 45 deletions

View file

@ -25,10 +25,10 @@ apply Dependency "<%= @object_name %>" to "<%= @object_type %>"{
child_service_name = "<%= @child_service_name -%>" child_service_name = "<%= @child_service_name -%>"
<%- end -%> <%- end -%>
<%- if @disable_checks -%> <%- if @disable_checks -%>
disable_checks = <%= @disable_checks -%> disable_checks = <%= @disable_checks %>
<%- end -%> <%- end -%>
<%- if @disable_notifications -%> <%- if @disable_notifications -%>
disable_notifications = <%= @disable_notifications -%> disable_notifications = <%= @disable_notifications %>
<%- end -%> <%- end -%>
<%- if @period -%> <%- if @period -%>
period = "<%= @period -%>" period = "<%= @period -%>"
@ -37,9 +37,9 @@ apply Dependency "<%= @object_name %>" to "<%= @object_type %>"{
states = [ <%- @states.each do |state| -%> <%= state %>, <%- end -%>] states = [ <%- @states.each do |state| -%> <%= state %>, <%- end -%>]
<%- end -%> <%- end -%>
<%- if @assign_where -%> <%- if @assign_where -%>
assign where <%= @assign_where -%> assign where <%= @assign_where %>
<%- end -%> <%- end -%>
<%- if @ignore_where -%> <%- if @ignore_where -%>
ignore where <%= @ignore_where -%> ignore where <%= @ignore_where %>
<%- end -%> <%- end -%>
} }

View file

@ -40,34 +40,34 @@ apply Service "<%= @object_servicename %>" to Host {
<%- end -%> <%- end -%>
<%- end -%> <%- end -%>
<%- if @max_check_attempts -%> <%- if @max_check_attempts -%>
max_check_attempts = <%= @max_check_attempts -%> max_check_attempts = <%= @max_check_attempts %>
<%- end -%> <%- end -%>
<%- if @check_period -%> <%- if @check_period -%>
check_period = <%= @check_period -%> check_period = <%= @check_period %>
<%- end -%> <%- end -%>
<%- if @check_interval -%> <%- if @check_interval -%>
check_interval = <%= @check_interval -%> check_interval = <%= @check_interval %>
<%- end -%> <%- end -%>
<%- if @retry_interval -%> <%- if @retry_interval -%>
retry_interval = <%= @retry_interval -%> retry_interval = <%= @retry_interval %>
<%- end -%> <%- end -%>
<%- if @enable_notifications -%> <%- if @enable_notifications -%>
enable_notifications = <%= @enable_notifications -%> enable_notifications = <%= @enable_notifications %>
<%- end -%> <%- end -%>
<%- if @enable_active_checks -%> <%- if @enable_active_checks -%>
enable_active_checks = <%= @enable_active_checks -%> enable_active_checks = <%= @enable_active_checks %>
<%- end -%> <%- end -%>
<%- if @enable_passive_checks -%> <%- if @enable_passive_checks -%>
enable_passive_checks = <%= @enable_passive_checks -%> enable_passive_checks = <%= @enable_passive_checks %>
<%- end -%> <%- end -%>
<%- if @enable_event_handler -%> <%- if @enable_event_handler -%>
enable_event_handler = <%= @enable_event_handler -%> enable_event_handler = <%= @enable_event_handler %>
<%- end -%> <%- end -%>
<%- if @enable_flapping -%> <%- if @enable_flapping -%>
enable_flapping = <%= @enable_flapping -%> enable_flapping = <%= @enable_flapping %>
<%- end -%> <%- end -%>
<%- if @enable_perfdata -%> <%- if @enable_perfdata -%>
enable_perfdata = <%= @enable_perfdata -%> enable_perfdata = <%= @enable_perfdata %>
<%- end -%> <%- end -%>
<%- if @event_command -%> <%- if @event_command -%>
event_command = "<%= @event_command -%>" event_command = "<%= @event_command -%>"

View file

@ -21,10 +21,10 @@ object Dependency "<%= @object_name %>" {
child_service_name = "<%= @child_service_name -%>" child_service_name = "<%= @child_service_name -%>"
<%- end -%> <%- end -%>
<%- if @disable_checks -%> <%- if @disable_checks -%>
disable_checks = <%= @disable_checks -%> disable_checks = <%= @disable_checks %>
<%- end -%> <%- end -%>
<%- if @disable_notifications -%> <%- if @disable_notifications -%>
disable_notifications = <%= @disable_notifications -%> disable_notifications = <%= @disable_notifications %>
<%- end -%> <%- end -%>
<%- if @period -%> <%- if @period -%>
period = "<%= @period -%>" period = "<%= @period -%>"

View file

@ -37,34 +37,34 @@ object Host "<%= @object_hostname %>" {
check_command = "<%= @check_command -%>" check_command = "<%= @check_command -%>"
<%- end -%> <%- end -%>
<%- if @max_check_attempts -%> <%- if @max_check_attempts -%>
max_check_attempts = <%= @max_check_attempts -%> max_check_attempts = <%= @max_check_attempts %>
<%- end -%> <%- end -%>
<%- if @check_period -%> <%- if @check_period -%>
check_period = <%= @check_period -%> check_period = <%= @check_period %>
<%- end -%> <%- end -%>
<%- if @check_interval -%> <%- if @check_interval -%>
check_interval = <%= @check_interval -%> check_interval = <%= @check_interval %>
<%- end -%> <%- end -%>
<%- if @retry_interval -%> <%- if @retry_interval -%>
retry_interval = <%= @retry_interval -%> retry_interval = <%= @retry_interval %>
<%- end -%> <%- end -%>
<%- if @enable_notifications -%> <%- if @enable_notifications -%>
enable_notifications = <%= @enable_notifications -%> enable_notifications = <%= @enable_notifications %>
<%- end -%> <%- end -%>
<%- if @enable_active_checks -%> <%- if @enable_active_checks -%>
enable_active_checks = <%= @enable_active_checks -%> enable_active_checks = <%= @enable_active_checks %>
<%- end -%> <%- end -%>
<%- if @enable_passive_checks -%> <%- if @enable_passive_checks -%>
enable_passive_checks = <%= @enable_passive_checks -%> enable_passive_checks = <%= @enable_passive_checks %>
<%- end -%> <%- end -%>
<%- if @enable_event_handler -%> <%- if @enable_event_handler -%>
enable_event_handler = <%= @enable_event_handler -%> enable_event_handler = <%= @enable_event_handler %>
<%- end -%> <%- end -%>
<%- if @enable_flapping -%> <%- if @enable_flapping -%>
enable_flapping = <%= @enable_flapping -%> enable_flapping = <%= @enable_flapping %>
<%- end -%> <%- end -%>
<%- if @enable_perfdata -%> <%- if @enable_perfdata -%>
enable_perfdata = <%= @enable_perfdata -%> enable_perfdata = <%= @enable_perfdata %>
<%- end -%> <%- end -%>
<%- if @event_command -%> <%- if @event_command -%>
event_command = "<%= @event_command -%>" event_command = "<%= @event_command -%>"

View file

@ -23,9 +23,9 @@ object HostGroup "<%= @object_hostgroup_name %>" {
groups = [ <%- @groups.each do |group| -%> "<%= group %>", <%- end -%>] groups = [ <%- @groups.each do |group| -%> "<%= group %>", <%- end -%>]
<%- end -%> <%- end -%>
<%- if @assign_where -%> <%- if @assign_where -%>
assign where <%= @assign_where -%> assign where <%= @assign_where %>
<%- end -%> <%- end -%>
<%- if @ignore_where -%> <%- if @ignore_where -%>
ignore where <%= @ignore_where -%> ignore where <%= @ignore_where %>
<%- end -%> <%- end -%>
} }

View file

@ -54,11 +54,11 @@ object Notification "<%= @object_notificationname %>" {
<%- end -%> <%- end -%>
<%- if @interval -%> <%- if @interval -%>
interval = <%= @inteval -%> interval = <%= @inteval %>
<%- end -%> <%- end -%>
<%- if @period -%> <%- if @period -%>
period = <%= @period -%> period = <%= @period %>
<%- end -%> <%- end -%>
<%- if @types.empty? !=true -%> <%- if @types.empty? !=true -%>

View file

@ -25,7 +25,7 @@ object ScheduledDowntime "<%= @object_scheduleddowntimename %>" {
fixed = false fixed = false
<%- end -%> <%- end -%>
<%- if @duration -%> <%- if @duration -%>
duration = <%= @duration -%> duration = <%= @duration %>
<%- end -%> <%- end -%>
<%- if @ranges.empty? != true -%> <%- if @ranges.empty? != true -%>

View file

@ -34,34 +34,34 @@ object Service "<%= @object_servicename %>" {
check_command = "<%= @check_command -%>" check_command = "<%= @check_command -%>"
<%- end -%> <%- end -%>
<%- if @max_check_attempts -%> <%- if @max_check_attempts -%>
max_check_attempts = <%= @max_check_attempts -%> max_check_attempts = <%= @max_check_attempts %>
<%- end -%> <%- end -%>
<%- if @check_period -%> <%- if @check_period -%>
check_period = <%= @check_period -%> check_period = <%= @check_period %>
<%- end -%> <%- end -%>
<%- if @check_interval -%> <%- if @check_interval -%>
check_interval = <%= @check_interval -%> check_interval = <%= @check_interval %>
<%- end -%> <%- end -%>
<%- if @retry_interval -%> <%- if @retry_interval -%>
retry_interval = <%= @retry_interval -%> retry_interval = <%= @retry_interval %>
<%- end -%> <%- end -%>
<%- if @enable_notifications -%> <%- if @enable_notifications -%>
enable_notifications = <%= @enable_notifications -%> enable_notifications = <%= @enable_notifications %>
<%- end -%> <%- end -%>
<%- if @enable_active_checks -%> <%- if @enable_active_checks -%>
enable_active_checks = <%= @enable_active_checks -%> enable_active_checks = <%= @enable_active_checks %>
<%- end -%> <%- end -%>
<%- if @enable_passive_checks -%> <%- if @enable_passive_checks -%>
enable_passive_checks = <%= @enable_passive_checks -%> enable_passive_checks = <%= @enable_passive_checks %>
<%- end -%> <%- end -%>
<%- if @enable_event_handler -%> <%- if @enable_event_handler -%>
enable_event_handler = <%= @enable_event_handler -%> enable_event_handler = <%= @enable_event_handler %>
<%- end -%> <%- end -%>
<%- if @enable_flapping -%> <%- if @enable_flapping -%>
enable_flapping = <%= @enable_flapping -%> enable_flapping = <%= @enable_flapping %>
<%- end -%> <%- end -%>
<%- if @enable_perfdata -%> <%- if @enable_perfdata -%>
enable_perfdata = <%= @enable_perfdata -%> enable_perfdata = <%= @enable_perfdata %>
<%- end -%> <%- end -%>
<%- if @event_command -%> <%- if @event_command -%>
event_command = "<%= @event_command -%>" event_command = "<%= @event_command -%>"

View file

@ -23,9 +23,9 @@ object ServiceGroup "<%= @object_servicegroup_name %>" {
groups = [ <%- @groups.each do |group| -%> "<%= group %>", <%- end -%>] groups = [ <%- @groups.each do |group| -%> "<%= group %>", <%- end -%>]
<%- end -%> <%- end -%>
<%- if @assign_where -%> <%- if @assign_where -%>
assign where <%= @assign_where -%> assign where <%= @assign_where %>
<%- end -%> <%- end -%>
<%- if @ignore_where -%> <%- if @ignore_where -%>
ignore where <%= @ignore_where -%> ignore where <%= @ignore_where %>
<%- end -%> <%- end -%>
} }

View file

@ -22,6 +22,6 @@ object StatusDataWriter "<%= @object_statusdatawritername %>" {
objects_path = "<%= @objects_path -%>" objects_path = "<%= @objects_path -%>"
<%- end -%> <%- end -%>
<%- if @update_interval -%> <%- if @update_interval -%>
update_interval = <%= @update_interval -%> update_interval = <%= @update_interval %>
<%- end -%> <%- end -%>
} }

View file

@ -26,7 +26,7 @@ object User "<%= @object_username %>" {
pager = "<%= @pager -%>" pager = "<%= @pager -%>"
<%- end -%> <%- end -%>
<%- if @enable_notifications -%> <%- if @enable_notifications -%>
enable_notifications = <%= @enable_notifications -%> enable_notifications = <%= @enable_notifications %>
<%- end %> <%- end %>
<%- if @vars.empty? != true -%> <%- if @vars.empty? != true -%>
<%- @vars.each_pair do |key, value| -%> <%- @vars.each_pair do |key, value| -%>