Admittedly I haven't. I didn't really want to go chasing after something
that has an established practice/pattern or is for some reason a bad idea.

I assumed Facter.value would pull from a cache of some sort, but clearly
that was just a speculative fantasy on my part. If it computes it each time
Facter.value is called that certainly kills that method.

The rough idea I had in my head was to check to see if the value of the
fact was currently set. If it evaluates to "root" and isn't already
defined, set nothing or some arbitrary value.



On Wed, Sep 3, 2014 at 2:23 PM, Felix Frank <felix.fr...@alumni.tu-berlin.de
> wrote:

> On 09/03/2014 06:32 PM, Khoury Brazil wrote:
> > Sorry for the delay Felix. Here's a specific example of a situation
> > where the fact might return what I would consider useless information
> > and I would want to revert back to a the value set previously:
> >
> > On OS X you can have an active user that is at the console and owns
> > /dev/console. If you want to gather that information it's fairly
> > straightforward. But under certain circumstances the owner of the
> > console is root. In that scenario I'd still want the data set on the
> > fact prior to that to persist. My thinking is that I can just validate
> > the data returned (within the plugin itself) and if it doesn't meet my
> > criteria, I can set the fact to itself using Facter.value(console_user).
>
> So have you tried that?
>
> I would assume that all you achieve by calling Facter.value from within
> the fact's own setcode block is an endless loop.
>
> I know of no internal cache for fact values that have been evaluated
> earlier.
>
> Even if there were such a thing, how would it work if the "root" case is
> it during Facter's first execution?
>
> --
> You received this message because you are subscribed to the Google Groups
> "Puppet Users" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to puppet-users+unsubscr...@googlegroups.com.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/puppet-users/540786E1.4020004%40Alumni.TU-Berlin.de
> .
> For more options, visit https://groups.google.com/d/optout.
>

-- 
You received this message because you are subscribed to the Google Groups 
"Puppet Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to puppet-users+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/puppet-users/CAAqoMCZk8JAhYBnkv7OERWOMuu-PsHwRqv2Cdy5t675Y-R59ww%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to