Issue #12337 has been updated by Stefan Schulte.

Status changed from Needs Decision to Needs More Information
Assignee changed from Daniel Pittman to Nan Liu

Facter in general allows dependent facts. It just doesn't tell when it reaches 
a recursion and these recursions are not always easy to find.

I suspect the following:
`my_osfamily` loads the `osfamiliy` fact in an earlier stage than before: 
`osfamily` now depends on `operatingsystem`. `Operatingsystem` on ubuntu relies 
on the `lsbdistid` fact. This fact can currently trigger recursions as 
described in https://github.com/puppetlabs/facter/pull/176. So it would be 
interesting what operatingsystem you are on and what "This not only returns the 
wrong value" actually means.
----------------------------------------
Bug #12337: Can not use nest facts when writing custom facts
https://projects.puppetlabs.com/issues/12337#change-59787

Author: Nan Liu
Status: Needs More Information
Priority: Normal
Assignee: Nan Liu
Category: library
Target version: 
Keywords: 
Branch: 
Affected Facter version: 


This not only returns the wrong value, it also breaks osfamily:

    Facter.add('my_osfamily')
      setcode do
        Facter.value(:osfamily)
      end
    end

It's as if operatingsystem doesn't get loaded before it obtaining 
osfamily.<del> It's necessary for force loading before using a fact that 
depends on another fact to get the correct values:</del> Actually this doesn't 
work.

    Facter.collection.loader.load(:operatingsystem)
    Facter.collection.loader.load(:osfamily)


-- 
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