the injection pattern for extending charms
Gary Poster
gary.poster at canonical.com
Fri Aug 30 12:12:53 UTC 2013
On 08/24/2013 12:30 PM, Patrick Hetu wrote:
> Hi guys,
Hi Patrick. Sorry for the slow reply.
> I was looking for a way to extends the buildbot-master charm
> to be able to add configuration chunks from an other charm or
> a subordinate. For configuring the new OpenStack latent buildslave for
> example:
>
> http://docs.buildbot.net/current/manual/cfg-buildslaves.html?highlight=latent#openstack
>
> The way I was going to propose was to add a buildbot-settings provider
> to metadata.yaml file.
This would be a link to a git repo or similar? If so, I like it.
> Charms will then use it to send configuration that would be injected a
> "juju_settings" directory
> in the buildbot install directory.
>
> I would then add this python code at the end of the master.cfg file:
>
>
> import imp
> import glob
> from os.path import abspath, dirname, join
>
> PROJECT_DIR = abspath(dirname(__file__))
>
> conffiles = glob.glob(join(PROJECT_DIR, 'juju_settings', '*.py'))
>
> for f in conffiles:
> execfile(abspath(f))
>
>
>
> The code sent by charms or subordinates would be in this form:
>
> c['buildbotURL'] = "http://my_new_url_here"
> c['builders'] += your_builder_code_here
> c['schedulers'] += your_schedulers_code_here
> etc
>
>
> This is the pattern I used in the python-django charm to extend the
> settings. So before
> spreading the pattern, I would like to have your opinion.
FWIW, my team developed the buildbot charms early last year. We have
not maintained it for a long time, and it would be great for the charms
to have a maintainer, hint hint hint...
Gary
>
> Cheers,
>
> Patrick
>
>
More information about the Juju
mailing list