Bug with @when_not

Cory Johns cory.johns at canonical.com
Wed Dec 16 21:27:16 UTC 2015


The next release of the charms.reactive library (probably coming today)
will include a fix for the behavior of @when_not.

See https://github.com/juju-solutions/charms.reactive/pull/43 for more
information, but in short, @when_not was intended to behave as @when_none,
i.e. it should trigger if none of the states were active and *not* trigger
if any of the states were active.  Instead, it was incorrectly triggering
as long as any one of the states were not active.

This  was a subtle difference, and one I'm hopeful hasn't affected anyone,
but if you are depending on this behavior, it is recommended that you break
apart your handlers such that it is exact and explicit what the triggering
conditions are and what states will be active vs not active when the
handler is entered.

I also added the aliases @when_all and @when_none in case they are more
clear what the expected behavior is.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.ubuntu.com/archives/juju/attachments/20151216/bfe11c89/attachment.html>


More information about the Juju mailing list