Juju configuration in bash
Marco Ceppi
marco.ceppi at canonical.com
Fri Oct 2 23:59:38 UTC 2015
Hello!
Yes, you certainly can. In fact, the charmhelpers python library is just a
shim to make writing charms in python easier. In bash you'll want to do
something like the following:
option=$(config-get option)
This is, essentially what the charmhelpers library is doing under the
covers. There's a WIDE range of these hook tools you can use in your hooks,
for an exhaustive list run
juju help-tool
And to learn more how to use a tool, run
juju help-tool config-get
Thanks!
Marco Ceppi
On Fri, Oct 2, 2015 at 7:33 PM Frederico Araujo <araujof at gmail.com> wrote:
> Hi list,
>
> Is there a way to get the configuration options from config.yaml from a
> hook written in Bash (e.g., environment variable)? I noticed that in Python
> we can import from the charmshelper API like this:
>
> 1. from charmhelpers.core.hookenv import (
> 2. config as config_get,
> 3. ...
>
>
> And then use config_get['option'] to retrieve the option value.
>
> Thanks,
>
> Fred
>
>
> --
> Juju mailing list
> Juju at lists.ubuntu.com
> Modify settings or unsubscribe at:
> https://lists.ubuntu.com/mailman/listinfo/juju
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.ubuntu.com/archives/juju/attachments/20151002/19e6c72b/attachment.html>
More information about the Juju
mailing list