[Puppet Users] Templates see numbers as strings

2013-06-25 Thread Claudio

Given the manifest:

 $a = 1
 $b = 1 + 0
 $c = 1.1
 $d = 1.1 + 0
 $result = inline_template(
 a %= @a.class % %= @a %
 b %= @b.class % %= @b %
 c %= @c.class % %= @c %
 d %= @d.class % %= @d %
 )
 notify {
 $result:
 }



The output is:

 a String 1
 b Fixnum 1
 c String 1.1
 d Float 1.1



Is this working as intended?

How can I identify number types within the template without adding + 0 on 
the manifest? I'm aware that it's not a good idea to duck-type on templates 
but I'm still wondering.


--
Claudio

-- 
You received this message because you are subscribed to the Google Groups 
Puppet Users group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to puppet-users+unsubscr...@googlegroups.com.
To post to this group, send email to puppet-users@googlegroups.com.
Visit this group at http://groups.google.com/group/puppet-users.
For more options, visit https://groups.google.com/groups/opt_out.




[Puppet Users] Re: Templates see numbers as strings

2013-06-25 Thread Claudio
I forgot to clarify that this was tested on versions 3.2.1 and 3.2.2.

On Tuesday, June 25, 2013 1:06:21 PM UTC-3, Claudio wrote:


 Given the manifest:

 $a = 1
 $b = 1 + 0
 $c = 1.1
 $d = 1.1 + 0
 $result = inline_template(
 a %= @a.class % %= @a %
 b %= @b.class % %= @b %
 c %= @c.class % %= @c %
 d %= @d.class % %= @d %
 )
 notify {
 $result:
 }



 The output is:

 a String 1
 b Fixnum 1
 c String 1.1
 d Float 1.1



 Is this working as intended?

 How can I identify number types within the template without adding + 0 
 on the manifest? I'm aware that it's not a good idea to duck-type on 
 templates but I'm still wondering.


 --
 Claudio



-- 
You received this message because you are subscribed to the Google Groups 
Puppet Users group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to puppet-users+unsubscr...@googlegroups.com.
To post to this group, send email to puppet-users@googlegroups.com.
Visit this group at http://groups.google.com/group/puppet-users.
For more options, visit https://groups.google.com/groups/opt_out.