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 <arau...@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@lists.ubuntu.com
> Modify settings or unsubscribe at:
> https://lists.ubuntu.com/mailman/listinfo/juju
>
-- 
Juju mailing list
Juju@lists.ubuntu.com
Modify settings or unsubscribe at: 
https://lists.ubuntu.com/mailman/listinfo/juju

Reply via email to