Issue #3704 has been updated by Adrien Thebo.

We've been looking into adding more complex data types into Puppet, and as it 
turns out this is pretty hard. Right now we stringify all facts in Puppet after 
they've been retrieved, and changing this has some pretty significant changes 
in how Puppet handles facts. Puppet itself and applications using the stored 
facts that Puppet generates have all been built to expect that Puppet provides 
facts as string typed key/value pairs, and changing this requires a non-trivial 
amount of work inside of Puppet itself. Right now Facter itself can and will 
return arbitrary types, but we just can't use them inside of Puppet.
----------------------------------------
Bug #3704: Facter doesn't return booleans (converts them to strings instead)
https://projects.puppetlabs.com/issues/3704

Author: Sebastian Kayser
Status: Accepted
Priority: Normal
Assignee: 
Category: library
Target version: 2.0.0
Keywords: 
Branch: 
Affected Facter version: 


I am just getting started with puppet/facter and it took me a quite while to 
realize that facter seems to convert custom boolean facts to strings (tried 
boolean comparisons in my puppet recipes for ages before realizing it). This 
has also been reported here 
http://groups.google.de/group/puppet-users/msg/c1939ed3b4404668 where Luke 
asked to file a bug report. As I couldn't find one, here it goes.

Example:

<pre>
$ ls
test.pp  test.rb

$ cat test.rb
Facter.add("myfact") do
  setcode do
    true
  end
end

$ cat test.pp
notice($myfact)
if $myfact == true {
  notice("Boolean ... just like I expected!") 
} else { if $myfact == 'true' {
  notice("Houston ... it's a string!")
}}

$ FACTERLIB=. puppet test.pp
notice: Scope(Class[main]): true
notice: Scope(Class[main]): Houston ... it's a string!

$ puppet --version
0.25.4
$ facter --version
1.5.7
</pre>


-- 
You have received this notification because you have either subscribed to it, 
or are involved in it.
To change your notification preferences, please click here: 
http://projects.puppetlabs.com/my/account

-- 
You received this message because you are subscribed to the Google Groups 
"Puppet Bugs" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/puppet-bugs?hl=en.

Reply via email to