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?
- 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?
- Any particular reason for cat'ing /proc/uptime rather than opening  
the file directly?

Regards,

Felix

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