First customer pain point pull request - default-hook

William Reade william.reade at canonical.com
Tue Aug 19 15:35:19 UTC 2014


On Tue, Aug 19, 2014 at 4:00 PM, Aaron Bentley <aaron.bentley at canonical.com>
wrote:

> -----BEGIN PGP SIGNED MESSAGE-----
> Hash: SHA1
>
> On 14-08-19 09:42 AM, Gustavo Niemeyer wrote:
> > I have never seen myself a single charm that completely ignores
> > all the action cues to simply re-read the whole state from the
> > ground up,
>
> The cs:~juju-qa/precise/juju-reports charm follows this general
> pattern, but there are some specialized hooks: install, start, stop
> and upgrade-charm.
>

...and in case it's not clear: defined hooks would still continue to run at
the appropriate times, so exceptions can be accommodated. But I think it
becomes valuable as soon as there's any subset of hooks (most likely,
indeed, the relation ones) where the charm's put in a position of
rescanning the world one change at a time -- in which case all such
situations can be handled in batches at a more measured cadence.

config-changed, database-relation-broken, database-relation-changed,
> database-relation-departed, and website-relation-changed are all the
> same code and read the state afresh every time without reference to
> the script name.
>
> The charmworld charm is similar.
>

And I'd be most interested to hear from anyone else who is also finding
this mode of interaction with juju to be convenient...

Cheers
William
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.ubuntu.com/archives/juju-dev/attachments/20140819/bbd69f78/attachment.html>


More information about the Juju-dev mailing list