We can skip the new state if no one is depending on or finds the existing
behavior useful (I suspect that may be true).

On Fri, Apr 22, 2016 at 5:37 PM, Mark Shuttleworth <m...@ubuntu.com> wrote:

>
> 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?
>
>
>
>
>
>
-- 
Juju mailing list
Juju@lists.ubuntu.com
Modify settings or unsubscribe at: 
https://lists.ubuntu.com/mailman/listinfo/juju

Reply via email to