----- Original Message -----
> From: "Jeff McCune" <j...@puppetlabs.com>
> To: puppet-dev@googlegroups.com
> Sent: Monday, October 22, 2012 11:12:19 PM
> Subject: Re: [Puppet-dev] runmode
> 
> 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.

yes, what I am trying to do is write a wrapper that provides a unified
single API around both 2.7 and 3 behaviours so that tools like MCollective
can have some hope of managing Puppet in the face of ever changing behaviour

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

yeah I am writing a versioned API that I can capture the changes in, we
should at least be good for the duration of 3.0.x though and hopefully
by then Puppet will have stabilised this API but until the team consider
that a priority unfortunately even getting our own tools to use puppet
is going to be hacktacular.


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