Backwards incompatible change to config.changed states
Mark Shuttleworth
mark at ubuntu.com
Fri Apr 22 21:37:37 UTC 2016
I would strongly prefer not to add states lightly. Can we take some time
to see if this is avoidable?
Mark
On 22/04/16 16:02, Cory Johns wrote:
> 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/0141b329/attachment.html>
More information about the Juju
mailing list