Handling uninstallation upon subordinate removal in reactive

Tilman Baumann tilman.baumann at canonical.com
Tue Nov 21 16:17:13 UTC 2017



On 21.11.2017 15:58, Junien Fridrick wrote:
> The only way I can think of is to use @hook('stop'), but as far as I
> remember, using hooks is not something one should do in the reactive
> world.

No, just fine. Most of the time when you think hook, reactive will have
a abstract handler for it. But not for all things.

Very simple example
https://github.com/tbaumann/charm-logstash-conf-d/blob/master/reactive/logstash_conf-d.py#L36


> 
> Does anyone have any advice for doing that properly ?
> 
> I was also thinking that maybe the snap layer could save which
> application installed which snap, and if said application is removed,
> then remove said snap. Would that be a good idea ?

Totally. At least if you are sure that you where the only one who could
have installed the snap.



More information about the Juju mailing list