2010/6/10 Héctor Rivas Gándara <[email protected]>:
> I think it simply could detect that the command (swap -l ) failed and
> raise an exception with the output (or first line of the output).

Potentially yes, we should change how util.exec works and enable
logging to user/exception passing to lib callers. However that's quite
brittle atm, and we'd need to rewrite a bunch of facts to dtrt.

But using puts isn't the right thing to do here.

> Now it fails with a nil access error, I had to see the code to
> determine that the problem was that I was running facter as a normal
> user and 'swap -l' was failing.

If we know a fact needs root, we should make that explicit, dmidecode
based stuff will also fail.

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