Hi Guillaume,

I would say that the fact looks pretty solid, with one little detail. The
way facter was designed was to contain all of the logic to resolve a fact
within the setcode block. If one of the requires fail, ruby will throw a
LoadError, which facter will catch. However, if any of the logic outside of
the setcode block threw a NoMethodError or any exception that isn't a child
of ScriptError, facter will not catch it and subsequently crash. In this
specific case, the fact you wrote should be fine, but in the general case,
you would want a fact to be entirely self contained within the setcode
block.

On Tue, Jun 28, 2011 at 6:57 AM, Guillaume Rousse
<guillomovi...@gmail.com>wrote:

> Hello.
>
> Here is a custom fact I created for enumerating netgroups from an ldap
> directory. As I'm a total ruby newbie, I'd be interested by review for it.
> --
> BOFH excuse #439:
>
> Hot Java has gone cold
>
> --
> You received this message because you are subscribed to the Google Groups
> "Puppet Users" group.
> To post to this group, send email to puppet-users@googlegroups.com.
> To unsubscribe from this group, send email to
> puppet-users+unsubscr...@googlegroups.com.
> For more options, visit this group at
> http://groups.google.com/group/puppet-users?hl=en.
>
>

-- 
You received this message because you are subscribed to the Google Groups 
"Puppet Users" group.
To post to this group, send email to puppet-users@googlegroups.com.
To unsubscribe from this group, send email to 
puppet-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/puppet-users?hl=en.

Reply via email to