You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Values are written in an order (with a sort). I understand : this is puppet's logic.
But, I think it shouldn't be like this for arrays (see line 7). We're loosing the array's order to an alphabetic order :/
This is a problem because the array in puppet's config is not the same in the file (order has been changed).
For my part, I removed the sort and replaced this code :
<%- if value.is_a?(Array) -%>
<%- value.sort.each do |v| -%>
...
<%- end -%>
By this :
<%- if value.is_a?(Array) -%>
<%- value.each do |v| -%> # no sort
...
<%- end -%>
Everywhere arrays are ordered, so I was very surprised when I discovered the alphabetic order.
We're using a plugin which reads some RegExs in a config file and apply them one by one (in the config order) on strings. If Puppet changes the order of the regexs in config, the result will not be the same :(
Hello,
In the python module, there is a template used to write config files for collectd.
https://github.com/voxpupuli/puppet-collectd/blob/master/templates/plugin/python/module.conf.erb#L7
Values are written in an order (with a sort). I understand : this is puppet's logic.
But, I think it shouldn't be like this for arrays (see line 7). We're loosing the array's order to an alphabetic order :/
This is a problem because the array in puppet's config is not the same in the file (order has been changed).
For my part, I removed the sort and replaced this code :
<%- if value.is_a?(Array) -%>
<%- value.sort.each do |v| -%>
...
<%- end -%>
By this :
<%- if value.is_a?(Array) -%>
<%- value.each do |v| -%> # no sort
...
<%- end -%>
in this file : https://github.com/voxpupuli/puppet-collectd/blob/master/templates/plugin/python/module.conf.erb#L7
Thanks for your attention,
Gilles
The text was updated successfully, but these errors were encountered: