Hi,
And now the issue. It seems like the writer of the range()
function did not think about ranges with more than one digit that
need leading zeros in the first items, like "01..99", when you
usually want to have 01, 02, and so on. Ruby allows you to do
("01".."99") and that will do the right thing, but the range()
function provided with stdlib does some type conversion (detects
if it's a number, and changes the type to integer) which converts
"01" to 1 breaking this possibility.
Hey Pablo,
Just a question - do you have a NEED for it to be [01...99] with the
leading zero? If I understand correctly, the end result is the same,
as the range function will cast 01 to 1 and not BREAK because you pass
it 01 - correct? Maybe I'm missing why you would need to use 01
explicitly?
Yes, some of our machines are like "node01-node50", that's why I tried
to do that. The thing is that Ruby allows you to do that if you say
("00".."50") instead of (0..50). The only difference is that the array
will be of strings, and the second of integers. Maybe an example
illustrates better:
irb(main):008:0> ("08".."12").to_a
=> ["08", "09", "10", "11", "12"]
irb(main):010:0> (8..12).to_a
=> [8, 9, 10, 11, 12]
But then, the range() function in stdlib, makes a type conversion, that
breaks this possibility. I don't understand why do you do that
conversion... the function is just an interface to the "range"
capability of Ruby, right? I think it should allow the programmer to
choose the type he wants.
No problem. We've turned off Github Issues because we use our central
Redmine server for bug tracking -->
http://projects.puppetlabs.com/projects/modules/issues Please feel
free to file any module tickets here!
I saw that, but I can only see the tickets, cannot open one myself. Do
I have to create myself an account? How?
So, I tried to change that myself, but no matter what I do to the
range.rb file, the changes are not picked up by the node. Do I have to
do something to force a reload of the file? This runs in the server,
right?
Do you know if, after editing a .rb file, I have to force some kind of
reload to pick up the changes?
Thanks!
Pablo
--
You received this message because you are subscribed to the Google Groups "Puppet
Users" group.
To post to this group, send email to puppet-users@googlegroups.com.
To unsubscribe from this group, send email to
puppet-users+unsubscr...@googlegroups.com.
For more options, visit this group at
http://groups.google.com/group/puppet-users?hl=en.