Comment 11 for bug 2007976

Revision history for this message
Alex Kavanagh (ajkavanagh) wrote :

If this is about using hookenv.Config from an ops framework charm, then yes, the charm code will need to call hookenv._run_atstart() and hookenv._run_atexit() manually, as the ops framework doesn't do it automatically.

In classic charms, the class hookenv.Hook() makes the calls automatically, and in charms.reactive, the charms.reactive.__init__.py file calls hookenv._run_atexit() automatically as well.

Please also see this bug for more details: https://github.com/juju/charm-helpers/issues/772

So, @jneo8, good sleuthing! I'd say your suspicions are almost certainly correct.

The fix is probably to add a call to _run_at_exit() in a 'pre_commit' or 'commit' handler on the Ops framework.