On Jun 14, 2009, at 3:11 PM, Felix Schäfer wrote:

>
> Good Evening,
>
> Am 08.06.2009 um 16:15 schrieb Paul Nasrat:
>
>> I think we might be better here with splitting this out into two
>> confined resolvers, one for linux systems with /proc/uptime (which  
>> has
>> been around for a long time) and one for non-linux systems. I think
>> this will achieve the only do things once desire of your bug report
>> and clean up the code at the same time.
>>
>> eg:
>>
>> Facter.add(:uptime) do
>>   confine :kernel => %w{SunOS AIX}
>>   setcode do
>>      #generic uptime command processing
>>   end
>> end
>>
>> Facter.add(:uptime) do
>>   confine :kernel => :linux
>>   setcode do
>>       #/proc/uptime parsing and manipulation
>>       end
>>   end
>> end
>
> A few more questions have sprung up while mulling this over:
> - I suppose the confine part only works in a Facter.add block?

Correct.

>
> - is there more to Facter::Util::Resolution.exec() than wrapping %x{ }
> calls? I suppose the preferred way would be to use
> Facter::Util::Resolution.exec(). Any equivalent for reading files
> directly?

There's a bit more to the method, although not a lot.

There's no equivalent for reading files.
>
> - Any particular reason for cat'ing /proc/uptime rather than opening
> the file directly?


Someone's initial bad decision that was never corrected, most likely.

-- 
You've achieved success in your field when you don't know whether what
you're doing is work or play. -- Warren Beatty
---------------------------------------------------------------------
Luke Kanies | http://reductivelabs.com | http://madstop.com


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