Closed ftclausen closed 10 years ago
mmmm, this does not pass the test for the same reason ?
attributes/server.rb:12:57: C: Separate every 3 digits in the integer portion of a number with underscores(_).
default['zabbix']['server']['max_housekeeper_delete'] = 100000
^^^^^^
Maybe we should "100_000".to_i ?
100_000.to_s
=> "100000"
so 100_000
is a valid ruby integer. Can you change your commit to use it? (with squashing)
EDIT: more I read your PR, more I think I don't understand this problem xD So I may be wrong on what I'm saying.
The problem is that an integer quoted as a string such as
normal['some_attr'] = '100_000'
gets rendered verbatim in in templates. By making it unquoted it is properly rendered as a number e.g.
normal['some_attr'] = 100_000
@ftclausen ok, so can you please fix your commit to complain with rubocop?
@guilhem - yes, indeed, I'll fix this shortly.
Don't quote numbers otherwise the ruby underscore formatting (e.g. 100_000) is rendered in templates (should that formatting be added in the future or a wrapper cookbook).
I got bitten by this in a wrapper cookbook where, because the original attribute is quoted, it was rendered as text with an "_" which made the Zabbix server barf since that is not a valid number.