Issue #12337 has been updated by Ken Barber.

Maybe I'm doing something wrong, but I can't replicate this. Given a 
my_osfamily.rb file:

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

It works fine:

    # ./bin/facter my_osfamily
    RedHat
    # ./bin/facter osfamily
    RedHat

Is there something I'm missing here? Also:

    irb(main):001:0> require 'facter'
    => true
    irb(main):002:0> Facter["my_osfamily"].value
    => "RedHat"
    irb(main):003:0> 


----------------------------------------
Bug #12337: Can not use nest facts when writing custom facts
https://projects.puppetlabs.com/issues/12337

Author: Nan Liu
Status: Needs Decision
Priority: Normal
Assignee: Daniel Pittman
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