Comment 10 for bug 2007976

Revision history for this message
JamesLin (jneo8) wrote (last edit ):

I think I found the reason why persistent is not update.

If you deploy the charm in stable/quincy channel.
And you check the dispatch file in `/var/lib/juju/agents/unit-ceph-mon-0/charm/dispatch`
It shows it will execute `./src/charm.py`, which is an operator charm.

I'm not sure how this magic happen but in the end it will trigger config-change hook. But the logic of save previous config to persistent file is handle by charmhelper.core.hookenv.Hooks after the hook finish, check here [0]. Obviously the Hooks.execute function is not been triggered when we trigger hook like this way.

# Solution?

1. We can simply add a config save in the end of config change hook, which will update the persistent config.
2. Like Diko suggested, we can change the way how we parse the current ceph version.

---

[0]: https://git.launchpad.net/charm-helpers/tree/charmhelpers/core/hookenv.py#n957