Issue #3704 has been updated by Daniel Pittman.

Status changed from Accepted to Duplicate

This is basically a duplicate of #4561, which is a larger ticket covering 
various other sorts of structured data in Facter.  I have closed this to better 
reflect that, but linked the two together so the details don't get lost.  
Thanks.
----------------------------------------
Bug #3704: Facter doesn't return booleans (converts them to strings instead)
https://projects.puppetlabs.com/issues/3704

Author: Sebastian Kayser
Status: Duplicate
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