Backwards incompatible change to config.changed states

Cory Johns cory.johns at canonical.com
Fri Apr 22 21:02:52 UTC 2016


I have proposed https://github.com/juju-solutions/layer-basic/pull/61 as a
slight change to how the config.changed states from the basic layer work.
Currently, the changed states are set during the first hook invocation,
under the assumption that the values were "changed" from "nothing" (not
being set at all).  However, this is slightly problematic in a case like
the following, where we expect install() to  only be called once, unless
the value has changed after the fact:

@when_not('installed')def install():
    # do install
    set_state('installed')
@when('config.changed.install_source')def reinstall():
    install()


The proposal adds new states, config.new, and changes config.changed to not
be set the first time.  You could get the old behavior by saying
@when_any('config.new.foo', 'config.changed.foo').

Is anyone depending on the current behavior?  Are there any objections to
this change?
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.ubuntu.com/archives/juju/attachments/20160422/572aad0a/attachment.html>


More information about the Juju mailing list