On Sep 14, 2010, at 4:13 PM, Jesse A Wolfe wrote:

> 
> 
> So basically, you can see that the params aren't including the facts, and 
> this is a problem with the run_mode, which I don't quite understand.  Jesse 
> Wolfe should be able to help with that, I think, and once you've got that 
> sorted you should be all set.
> 
> 
> Basically the run_mode is an abstraction for which command line name you used 
> to invoke puppet - usually "master" or "agent" (but sometimes "user", for 
> other tools).
> In the pre-2.6.x world, this same logic would be controlled by the $0 ruby 
> variable (the name of the executable as invoked from your operating system)
> Things have gotten a little more complicated in the 2.6.x world, but not much.
> 
> Some places deep in the puppet code query Puppet.run_mode() directly, because 
> they used to query $0 directly. In a perfect world, we'd always pass 
> parameters to methods when we wanted different behavior, or at least use 
> other, smaller Puppet settings to set behavior.
> When I was designing it, it didn't occur to me that people writing scripts 
> using puppet as a library would need to care about run_mode - but as long as 
> code reaches to it to determine the behavior, I guess they will.
> Unfortunately there's not (yet) a direct way of changing it (this is tangled 
> up in way the Settings singleton works) - but setting $0 and/or changing ARGV 
> to what they would look like when running the puppet application you want to 
> ape, (*before* loading the puppet libs), should still work.
> So we're more-or-less in the same situation we've been in all along.


Is there a problem with just cutting all of the run_mode auto stuff, making it 
a global setting (on the RunMode class or on Puppet or whatever), and then 
making it easily assignable?

-- 
Debugging is twice as hard as writing the code in the first place.
Therefore, if you write the code as cleverly as possible, you are, by
definition, not smart enough to debug it.
        -- (attributed to) Brian W. Kernighan (unconfirmed)
---------------------------------------------------------------------
Luke Kanies  -|-   http://puppetlabs.com   -|-   +1(615)594-8199



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