Merge lp://qastaging/~danilo/charm-helpers/unset-config-change into lp://qastaging/charm-helpers
Proposed by
Данило Шеган
Status: | Work in progress |
---|---|
Proposed branch: | lp://qastaging/~danilo/charm-helpers/unset-config-change |
Merge into: | lp://qastaging/charm-helpers |
Diff against target: |
103 lines (+13/-29) 2 files modified
charmhelpers/core/hookenv.py (+2/-5) tests/core/test_hookenv.py (+11/-24) |
To merge this branch: | bzr merge lp://qastaging/~danilo/charm-helpers/unset-config-change |
Related bugs: |
Reviewer | Review Type | Date Requested | Status |
---|---|---|---|
Stuart Bishop (community) | Needs Fixing | ||
Review via email:
|
Commit message
Drop the entire load-config-
Description of the change
Drop the entire load-config-
Note that the only call-site to Config() is in hookenv.config() which always passes in the full service config data gotten by "config-get", so it seems perfectly safe to drop this (and the only correct thing to do, fwiw).
To post a comment you must log in.
Unmerged revisions
- 479. By Данило Шеган
-
Fix/remove tests to go with the new behaviour.
- 478. By Данило Шеган
-
Unsetting a value in charm config should unset a value in the stored config as well.
While hookenv.config() is always passed into the Config() constructor, this dictionary does not contain items added by the charm - only those items defined in the service configuration.
The end result is that if I do hookenv. config( )['whatsit_ configured' ] = True, then with this patch that flag will be lost in future hooks.
I suspect that to fix this that config items added by the charm will need to be tracked separately from the service config. We still need the load-config- from-saved- cache-and- tread-as- real-config, but only for new keys added by the charm and not for keys pulled in from hookenv.config() via the constructor.