Fixing hash ordering in erb templates
Signed-off-by: Alexandre Beche <alexandre.beche@gmail.com>
This commit is contained in:
parent
4fc9c9831c
commit
05f479d4f8
14 changed files with 33 additions and 33 deletions
|
@ -26,10 +26,10 @@ apply Notification "<%= @object_notificationname %>" to Host {
|
|||
command = "<%= @command %>"
|
||||
<%- end -%>
|
||||
<%- if @vars.empty? != true -%>
|
||||
<%- @vars.each_pair do |key,value| -%>
|
||||
<%- @vars.sort_by {|key, value| key}.each do |key, value| -%>
|
||||
<%= key %> = <% if value.class == String %><%= value %>
|
||||
<%- else -%>{
|
||||
<%- value.each_pair do |k,v| -%>
|
||||
<%- value.sort_by {|k, v| k}.each do |k, v| -%>
|
||||
<%= k %> = <%= v %>
|
||||
<%- end -%>
|
||||
}
|
||||
|
@ -44,7 +44,7 @@ apply Notification "<%= @object_notificationname %>" to Host {
|
|||
<%- end -%>
|
||||
<%- if @times.empty? != true -%>
|
||||
times = {
|
||||
<%- @times.each_pair do |key,value| -%>
|
||||
<%- @times.sort_by {|key, value| key}.each do |key, value| -%>
|
||||
<%= key %> = "<%= value %>"
|
||||
<%- end -%>
|
||||
}
|
||||
|
|
|
@ -29,10 +29,10 @@ apply Notification "<%= @object_notificationname %>" to Service {
|
|||
command = "<%= @command %>"
|
||||
<%- end -%>
|
||||
<%- if @vars.empty? != true -%>
|
||||
<%- @vars.each_pair do |key,value| -%>
|
||||
<%- @vars.sort_by {|key, value| key}.each do |key, value| -%>
|
||||
<%= key %> = <% if value.class == String %><%= value %>
|
||||
<%- else -%>{
|
||||
<%- value.each_pair do |k,v| -%>
|
||||
<%- value.sort_by {|k, v| k}.each do |k, v| -%>
|
||||
<%= k %> = <%= v %>
|
||||
<%- end -%>
|
||||
}
|
||||
|
@ -47,7 +47,7 @@ apply Notification "<%= @object_notificationname %>" to Service {
|
|||
<%- end -%>
|
||||
<%- if @times.empty? != true -%>
|
||||
times = {
|
||||
<%- @times.each_pair do |key,value| -%>
|
||||
<%- @times.sort_by {|key, value| key}.each do |key, value| -%>
|
||||
<%= key %> = "<%= value %>"
|
||||
<%- end -%>
|
||||
}
|
||||
|
|
|
@ -35,7 +35,7 @@ apply Service "<%= @object_servicename %>" to Host {
|
|||
check_command = "<%= @check_command -%>"
|
||||
<%- end -%>
|
||||
<%- if @vars.empty? != true -%>
|
||||
<%- @vars.each_pair do |key, value| -%>
|
||||
<%- @vars.sort_by {|key, value| key}.each do |key, value| -%>
|
||||
vars.<%= key %> = "<%= value %>"
|
||||
<%- end -%>
|
||||
<%- end -%>
|
||||
|
|
|
@ -27,7 +27,7 @@ object CheckCommand "<%= @object_checkcommandname %>" {
|
|||
<%- @arguments.each_with_index do |(key,value), i| -%>
|
||||
<%= key %> = <% if value.class == String %><%= value %>
|
||||
<%- else -%>{
|
||||
<%- value.each_pair do |k,v| -%>
|
||||
<%- value.sort_by {|k, v| k}.each do |k, v| -%>
|
||||
<%= k %> = <%= v %>
|
||||
<%- end -%>
|
||||
}
|
||||
|
@ -37,10 +37,10 @@ object CheckCommand "<%= @object_checkcommandname %>" {
|
|||
<%- end -%>
|
||||
|
||||
<%- if @vars -%>
|
||||
<%- @vars.each_pair do |key,value| -%>
|
||||
<%- @vars.sort_by {|key, value| key}.each do |key, value| -%>
|
||||
<%= key %> = <% if value.class == String %><%= value %>
|
||||
<%- else -%>{
|
||||
<%- value.each_pair do |k,v| -%>
|
||||
<%- value.sort_by {|k, v| k}.each do |k, v| -%>
|
||||
<%= k %> = <%= v %>
|
||||
<%- end -%>
|
||||
}
|
||||
|
@ -54,7 +54,7 @@ object CheckCommand "<%= @object_checkcommandname %>" {
|
|||
|
||||
<%- if @env -%>
|
||||
env = {
|
||||
<%- @vars.each_pair do |key,value| -%>
|
||||
<%- @vars.sort_by {|key, value| key}.each do |key, value| -%>
|
||||
<%= key %> = <%= value %>
|
||||
<%- end -%>
|
||||
}
|
||||
|
|
|
@ -27,7 +27,7 @@ object EventCommand "<%= @object_eventcommandname %>" {
|
|||
<%- @arguments.each_with_index do |(key,value), i| -%>
|
||||
<%= key %> = <% if value.class == String %><%= value %>
|
||||
<%- else -%>{
|
||||
<%- value.each_pair do |k,v| -%>
|
||||
<%- value.sort_by {|k, v| k}.each do |k, v| -%>
|
||||
<%= k %> = <%= v %>
|
||||
<%- end -%>
|
||||
}
|
||||
|
@ -37,10 +37,10 @@ object EventCommand "<%= @object_eventcommandname %>" {
|
|||
<%- end -%>
|
||||
<%- if @vars.empty? -%>
|
||||
|
||||
<%- @vars.each_pair do |key,value| -%>
|
||||
<%- @vars.sort_by {|key, value| key}.each do |key, value| -%>
|
||||
<%= key %> = <% if value.class == String %><%= value %>
|
||||
<%- else -%>{
|
||||
<%- value.each_pair do |k,v| -%>
|
||||
<%- value.sort_by {|k, v| k}.each do |k, v| -%>
|
||||
<%= k %> = <%= v %>
|
||||
<%- end -%>
|
||||
}
|
||||
|
@ -54,7 +54,7 @@ object EventCommand "<%= @object_eventcommandname %>" {
|
|||
<%- if @env.empty? != true -%>
|
||||
|
||||
env = {
|
||||
<%- @env.each_pair do |key,value| -%>
|
||||
<%- @env.sort_by {|key, value| key}.each do |key, value| -%>
|
||||
<%= key %> = <%= value %>
|
||||
<%- end -%>
|
||||
}
|
||||
|
|
|
@ -29,10 +29,10 @@ object Host "<%= @object_hostname %>" {
|
|||
groups = [ <%- @groups.each do |group| -%> "<%= group %>", <%- end -%>]
|
||||
<%- end -%>
|
||||
<%- if @vars.empty? != true -%>
|
||||
<%- @vars.each_pair do |key, value| -%>
|
||||
<%- @vars.sort_by {|key, value| key}.each do |key, value| -%>
|
||||
<%- if value.is_a?(Hash) -%>
|
||||
vars.<%= key %> = {
|
||||
<%- value.each_pair do |subkey,subvalue|-%>
|
||||
<%- value.sort_by {|subkey,subvalue| subkey}.each do |subkey,subvalue| -%>
|
||||
<%= subkey %> = <%= subvalue %>
|
||||
<%- end -%>
|
||||
}
|
||||
|
|
|
@ -45,7 +45,7 @@ object IdoMysqlConnection "mysql-ido" {
|
|||
|
||||
<%- if @cleanup.empty? != true -%>
|
||||
cleanup = {
|
||||
<%- @cleanup.each_pair do |key, value| -%>
|
||||
<%- @cleanup.sort_by {|key, value| key}.each do |key, value| -%>
|
||||
<%= key %> = <%= value %>
|
||||
<%- end -%>
|
||||
}
|
||||
|
@ -54,4 +54,4 @@ object IdoMysqlConnection "mysql-ido" {
|
|||
<%- if @categories.length != 0 -%>
|
||||
categories = <%= @categories.map {|category| "#{category}"}.join(' | ') %>
|
||||
<%- end -%>
|
||||
}
|
||||
}
|
||||
|
|
|
@ -45,7 +45,7 @@ object IdoPgsqlConnection "pgsql-ido" {
|
|||
|
||||
<%- if @cleanup.empty? != true -%>
|
||||
cleanup = {
|
||||
<%- @cleanup.each_pair do |key, value| -%>
|
||||
<%- @cleanup.sort_by {|key, value| key}.each do |key, value| -%>
|
||||
<%= key %> = <%= value %>
|
||||
<%- end -%>
|
||||
}
|
||||
|
@ -54,4 +54,4 @@ object IdoPgsqlConnection "pgsql-ido" {
|
|||
<%- if @categories.length != 0 -%>
|
||||
categories = <%= @categories.map {|category| "#{category}"}.join(' | ') %>
|
||||
<%- end -%>
|
||||
}
|
||||
}
|
||||
|
|
|
@ -26,10 +26,10 @@ object Notification "<%= @object_notificationname %>" {
|
|||
<%- end -%>
|
||||
<%- if @vars.empty? != true -%>
|
||||
|
||||
<%- @vars.each_pair do |key,value| -%>
|
||||
<%- @vars.sort_by {|key, value| key}.each do |key, value| -%>
|
||||
<%= key %> = <% if value.class == String %><%= value %>
|
||||
<%- else -%>{
|
||||
<%- value.each_pair do |k,v| -%>
|
||||
<%- value.sort_by {|k, v| k}.each do |k, v| -%>
|
||||
<%= k %> = <%= v %>
|
||||
<%- end -%>
|
||||
}
|
||||
|
@ -47,7 +47,7 @@ object Notification "<%= @object_notificationname %>" {
|
|||
<%- if @times.empty? != true -%>
|
||||
|
||||
times = {
|
||||
<%- @times.each_pair do |key,value| -%>
|
||||
<%- @times.sort_by {|key, value| key}.each do |key, value| -%>
|
||||
<%= key %> = <%= value %>
|
||||
<%- end -%>
|
||||
}
|
||||
|
|
|
@ -27,7 +27,7 @@ object NotificationCommand "<%= @object_notificationcommandname %>" {
|
|||
<%- @arguments.each_with_index do |(key,value), i| -%>
|
||||
<%= key %> = <% if value.class == String %><%= value %>
|
||||
<%- else -%>{
|
||||
<%- value.each_pair do |k,v| -%>
|
||||
<%- value.sort_by {|k, v| k}.each do |k, v| -%>
|
||||
<%= k %> = <%= v %>
|
||||
<%- end -%>
|
||||
}
|
||||
|
@ -37,10 +37,10 @@ object NotificationCommand "<%= @object_notificationcommandname %>" {
|
|||
<%- end -%>
|
||||
<%- if @vars.empty? != true -%>
|
||||
|
||||
<%- @vars.each_pair do |key,value| -%>
|
||||
<%- @vars.sort_by {|key, value| key}.each do |key, value| -%>
|
||||
<%= key %> = <% if value.class == String %><%= value %>
|
||||
<%- else -%>{
|
||||
<%- value.each_pair do |k,v| -%>
|
||||
<%- value.sort_by {|k, v| k}.each do |k, v| -%>
|
||||
<%= k %> = <%= v %>
|
||||
<%- end -%>
|
||||
}
|
||||
|
@ -54,7 +54,7 @@ object NotificationCommand "<%= @object_notificationcommandname %>" {
|
|||
<%- if @env.empty? != true -%>
|
||||
|
||||
env = {
|
||||
<%- @env.each_pair do |key,value| -%>
|
||||
<%- @env.sort_by {|key, value| key}.each do |key, value| -%>
|
||||
<%= key %> = <%= value %>
|
||||
<%- end -%>
|
||||
}
|
||||
|
|
|
@ -30,7 +30,7 @@ object ScheduledDowntime "<%= @object_scheduleddowntimename %>" {
|
|||
<%- if @ranges.empty? != true -%>
|
||||
|
||||
ranges = {
|
||||
<%- @ranges.each_pair do |key, value| -%>
|
||||
<%- @ranges.sort_by {|key, value| key}.each do |key, value| -%>
|
||||
"<%= key %>" = "<%= value %>"
|
||||
<%- end -%>
|
||||
}
|
||||
|
|
|
@ -26,7 +26,7 @@ object Service "<%= @object_servicename %>" {
|
|||
groups = [ <%- @groups.each do |group| -%> "<%= group %>", <%- end -%>]
|
||||
<%- end -%>
|
||||
<%- if @vars.empty? != true -%>
|
||||
<%- @vars.each_pair do |key, value| -%>
|
||||
<%- @vars.sort_by {|key, value| key}.each do |key, value| -%>
|
||||
vars.<%= key %> = "<%= value %>"
|
||||
<%- end -%>
|
||||
<%- end -%>
|
||||
|
|
|
@ -23,7 +23,7 @@ object TimePeriod "<%= @object_name %>" {
|
|||
<%- end -%>
|
||||
<%- if @ranges.empty? != true -%>
|
||||
ranges = {
|
||||
<%- @ranges.each_pair do |key,value| -%>
|
||||
<%- @ranges.sort_by {|key, value| key}.each do |key, value| -%>
|
||||
"<%= key %>" = "<%= value %>"
|
||||
<%- end -%>
|
||||
}
|
||||
|
|
|
@ -29,7 +29,7 @@ object User "<%= @object_username %>" {
|
|||
enable_notifications = <%= @enable_notifications %>
|
||||
<%- end %>
|
||||
<%- if @vars.empty? != true -%>
|
||||
<%- @vars.each_pair do |key, value| -%>
|
||||
<%- @vars.sort_by {|key, value| key}.each do |key, value| -%>
|
||||
vars.<%= key %> = "<%= value %>"
|
||||
<%- end -%>
|
||||
<%- end -%>
|
||||
|
@ -45,4 +45,4 @@ object User "<%= @object_username %>" {
|
|||
<%- if @states.length != 0 -%>
|
||||
states = [ <%- @states.each do |state| -%> <%= state %>, <%- end -%>]
|
||||
<%- end -%>
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue