charms.reactive all_states appears to be destructive #42

Closed
chuckbutler opened this Issue Dec 14, 2015 · 3 comments

Comments

Projects
None yet
3 participants
Contributor

chuckbutler commented Dec 14, 2015

when debugging a unit, i frequently forget that it's charms.reactive get_states to return the listing of active states on the unit.

when i run charms.reactive all_states this seems to wipe the current state of the machine, verified with charms.reactive get_states returning am empty dict

@chuckbutler chuckbutler added the bug label Dec 14, 2015

Contributor

mbruzek commented Dec 14, 2015

Caling "all_states" remove the states? Is that what is supposed to do? Or is it a nasty side effect of calling that method?

Owner

johnsca commented Dec 14, 2015

I'm unable to reproduce that:

ubuntu@murdoch:~$ charms.reactive get_states
{}
ubuntu@murdoch:~$ charms.reactive set_state foo
ubuntu@murdoch:~$ charms.reactive get_states
{u'foo': None}
ubuntu@murdoch:~$ charms.reactive set_state bar
ubuntu@murdoch:~$ charms.reactive get_states
{u'foo': None, u'bar': None}
ubuntu@murdoch:~$ charms.reactive all_states
ubuntu@murdoch:~$ charms.reactive get_states
{u'foo': None, u'bar': None}
ubuntu@murdoch:~$ charms.reactive all_states foo bar && echo Yep
Yep
ubuntu@murdoch:~$ charms.reactive all_states foo bar qux && echo Yep
ubuntu@murdoch:~$ charms.reactive all_states foo bar && echo Yep
Yep
ubuntu@murdoch:~$ charms.reactive get_states
{u'foo': None, u'bar': None}

Can you provide more info on how to reproduce that? That definitely should not happen!

Contributor

chuckbutler commented Dec 14, 2015

well, it appears this was a false positive. I'm going to close this for now pending further capacity to reproduce...

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