On Mon, Oct 22, 2012 at 2:55 PM, R.I.Pienaar <r...@devco.net> wrote:

>
> for 2.7 it seems this is the magic:
>
>    require 'puppet'
>    $puppet_application_mode = Puppet::Util::RunMode[:agent]
>    Puppet.settings.use :main, :agent
>    Puppet.parse_config
>
> have to say I am surprised about the global variable there, surely this is
> not how it works?


Sadly, yes, that's how it works.  I'm guessing it was easier to implement
this as a global variable since we don't really have a service locator or
what have you to cleanly get a handle on the runmode instance.

Also, please note that unless there's a documented, public method, if you
implement these behaviors yourself and we change the internal behaviors in
a bugfix or minor release, we make no guarantees about preserving
compatibility with the external world.

The best way forward on this is to submit a pull request that defines the
public API method you're looking for in Puppet 2.7.x _and_ 3.x.  If there's
a documented, public method that you're depending on, then we'll
maintain compatibility.  If there's not, and you're digging into the
internal behaviors, then all bets are off.

I mention this because I'd hate to see another broken integration when we
release a future version of Puppet.

-Jeff

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

Reply via email to