First customer pain point pull request - default-hook

William Reade william.reade at canonical.com
Wed Aug 20 14:08:00 UTC 2014


On Wed, Aug 20, 2014 at 10:46 AM, Matthew Williams <
matthew.williams at canonical.com> wrote:
>
> Any default-hook that deviated from this pattern could find itself being
> run multiple times in succession - I wonder if that might be confusing/
> unexpected to a charm author?
>

It'll run multiple times in succession regardless, independent of switching
-- but, yes, unless it switches it'll always do the same thing :). I don't
*think* it's unexpected that we'd run default-hook once for each missing
hook, supplying the substituted hook name every time.


> Gustavo's observation about hooks that the charm might no know about yet
> means that the else clause is absolutely required, I wonder if that's
> obvious to someone who's new to charming?
>

I'm pretty much adamant that we shouldn't even run new hooks, or expose new
tools, unless the charm explicitly declares it knows about them. But I do
imagine that many implementations will want the else anyway: they don't
need to provide an implementation for every single hook anyway.

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


More information about the Juju-dev mailing list