Config options without defaults never get removed from config.changed.x #79

Closed
simonklb opened this Issue Oct 18, 2016 · 4 comments

Comments

Projects
None yet
2 participants
Contributor

simonklb commented Oct 18, 2016

I think the problem originates from init_config_states() grabbing all of the config options from the yaml file while clear_config_states() only looks at hookenv.config(). Since hookenv.config() does not include the --all flag when executing the config-get command the options without a default are not included. That, and also due to the fact that config options are always changed when they have no previous value.

cmars commented Oct 18, 2016

I believe this might be the root cause: https://bugs.launchpad.net/charm-helpers/+bug/1630706

Contributor

simonklb commented Oct 18, 2016

I'm not sure. Looking at https://github.com/juju-solutions/layer-basic/blob/master/lib/charms/layer/basic.py#L155 that would remove the config.changed.x state. In my case the config.changed.x state is active even though I've never changed the option.

Contributor

simonklb commented Oct 24, 2016

For anyone that stumble upon this or is involved - I've added a fix proposal here: https://code.launchpad.net/~simonklb/charm-helpers/include-empty-config-options

chuckbutler added a commit to chuckbutler/layer-docker that referenced this issue Oct 24, 2016

Work around the 'config.changed' states firing always
This adds defaults of empty string instead of None/Null types which
causes interesting side-effect behavior when using the 'config.changed'
states provided by layer-basic.

This is a work-around for
juju-solutions/layer-basic#79 manifesting in
layer-docker.

@chuckbutler chuckbutler referenced this issue in juju-solutions/layer-docker Oct 24, 2016

Merged

Work around the 'config.changed' states firing always #95

Contributor

simonklb commented Nov 4, 2016

Fix is released in charmhelpers 0.10.0

@simonklb simonklb closed this Nov 4, 2016

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment