On 16 Aug 2008, at 21:23, Luke Kanies wrote:

>>
>> +    confine :kernel => :SunOS
>> +    setcode do
>> +        %{/usr/bin/zonename} if Facter.value(:kernelversion).to_f
>>> = 5.10
>>
> I don't think this will really work -- 5.10 == 5.1, so this will match
> any version of Solaris, basically, right?

Yeah you're right I've fixed this in my tree.
>
> I always prefer all of the data going into facts to be generated each
> time, whereas this code would have the number of zones calculated once
> when Facter starts up but never getting recalculated.  For long-
> running processes like puppetd, it would potentially miss changes in
> data.

OK, I need to think about this some, as we've got changeable data  
creating dynamically named facts. Currently we don't have any standard  
way of creating groups of facts, related to eg interface, or zone.

What is the behaviour of things like macaddress_eth0 in puppet if eth0  
went away? I think we need to think about this in the light of how we  
want dynamically named facts to behave.

irb -Ilib
 >> require 'facter'
 >> Facter[:sp_uptime]
=> nil
 >> Facter.loadfacts
=> true
 >> Facter[:sp_uptime]
 >> Facter[:sp_uptime].value
=> "up 10:20:38:46"
 >> Facter[:sp_uptime].value
=> "up 10:20:38:46"
 >> Facter[:sp_uptime].value
=> "up 10:20:38:46"
 >> Facter[:sp_uptime].value
=> "up 10:20:38:46"

Obviously this isn't behaving as you would expect. I think we need to  
think about the design here to enable not loading all the facts up  
front, but doing the correct thing for expiring and regenerating  
changing fact information in long running processes.


> I'd like to see tests for the facts themselves, too...

I'll need to think about how we test dynamically named facts, as  
calling loadfacts in the test seems less than optimal.

Paul

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"Puppet Developers" 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-dev?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to