Skip to content

Commit

Permalink
Fixes error related to ruby 1.8
Browse files Browse the repository at this point in the history
in ruby 1.8 elements of hashes aren't ordered. This causes puppet catalogs to be nondeterministic and therefor changes are made even when source data has not changed. Sorting the hash fixes this. In newer ruby versions this behaviour is fixed and hashes are ordered by insertion.
  • Loading branch information
m4xp0w4 authored Jan 20, 2017
1 parent ea6f04b commit e104253
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions templates/log.erb
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<% @sambaclassloglevel.each do |logclass, level| -%>
<% if not level.to_i.between?(0, 10) -%>
<% raise(Puppet::Error, "wrong log level for #{logclass}, must be between 0 and 10") -%>
<% @sambaclassloglevel.keys.sort.each do |key| -%>
<% if not @sambaclassloglevel[key].to_i.between?(0, 10) -%>
<% raise(Puppet::Error, "wrong log level for #{key}, must be between 0 and 10") -%>
<% end -%>
<%= logclass %>:<%= level -%>
<%= key %>:<%= @sambaclassloglevel[key] -%>
<% end -%>

0 comments on commit e104253

Please sign in to comment.