[master] Add missing 'fun' for returned events from "wfunc" SSH executions#54935
Conversation
|
I'll work on the tests ASAP |
2667230 to
07ea53f
Compare
There was a problem hiding this comment.
This can be just written as:
data.setdefault("fun", fun)But I am still not sure this is the right place of doing it. In handle_ssh the function might not appear due to various reasons there as well as the next element is just a text, so the data was just created above. In that case I would rather find out why fun key did not appeared at all and if it is a bug, then should be done in the mentioned method instead.
Maybe @thatch45 might help here.
There was a problem hiding this comment.
I'm following here the same approach that for id: in case it doesn't exist we explicitly add it.
There was a problem hiding this comment.
This looks right since this data is only part of the event it should not interfere with any other aspect of execution. Using data.setdefault("fun", fun) would also be an acceptable approach but it is not something that I am too concerned with here.
There was a problem hiding this comment.
My main concern is why sometimes "fun" and "Id" in this case needs to be checked. Shouldn't we rather move that above where "data" variable is redefined from string type to dict instead? I mean:
if isinstance(...
data = {"id": ...., "fun":...Instead of double-checking.
07ea53f to
d78bb19
Compare
363925e to
8aef6dd
Compare
|
@dwoz added missing unit tests |
|
@meaksh looks like this needs a rebase and theres some failing test although not certain they are related to your change. |
|
@Ch3LL I've updated the branch with latest changes from |
|
looks like pre-commit is failing and that should do it :) |
|
@Ch3LL done! 👍 Now it looks correct apart from the |
What does this PR do?
This PR fixes an issue when executing
wfuncs, for example,state.show_highstateoversalt-ssh.While the
state.show_highstateresponse is successfully received, the event that is fired to the "EventBus" is missing thefunattribute.This PR will add the
funto the fired event in case this is missing.Tests written?
Yes
Commits signed with GPG?
Yes