FEAT 60430: Add ability for wait_for_event to handle list event_id values#60443
Conversation
|
Hi there! Welcome to the Salt Community! Thank you for making your first contribution. We have a lengthy process for issues and PRs. Someone from the Core Team will follow up as soon as possible. In the meantime, here’s some information that may help as you continue your Salt journey.
There are lots of ways to get involved in our community. Every month, there are around a dozen opportunities to meet with other contributors and the Salt Core team and collaborate in real time. The best way to keep track is by subscribing to the Salt Community Events Calendar. |
more pythonic if/then/else on list Co-authored-by: Pedro Algarvio <pedro@algarvio.me>
|
@krionbsd sorry I haven't come back and checked on this, out on paternity :) Could someone have a look at this? Let me know if there are any blockers to merging. |
|
@krionbsd @s0undt3ch Sorry for the very late follow up on this...I got back from paternity leave not long ago, I believe this is still a valid MR. Is this still something I could get merged? You both have approved but I can't click the merge button. Thanks! |
|
Congratulations on your first PR being merged! 🎉 |
What does this PR do?
Adds support for comparing
id_listwith a list when the value forevent_idis a list in thesalt.wait_for_eventmodule.What issues does this PR fix or reference?
Fixes #60430
Previous Behavior
Previously,
salt.wait_for_eventonly supportedevent_idvalues that wherestr.New Behavior
In addition to the previous behavior, now supports
event_idvalues that are lists.Given the event:
{ "data": { "new": [], "lost": [ "some_old_node" ], "_stamp': '2021-06-23T15:02:04.621354" }, "tag": "salt/presence/change" }the following
salt.wait_for_eventwould not work peviously:This PR checks if the
valreturned by theevent_idlocation in the event is a list and if so, pops off any values fromid_listthat it finds invalMerge requirements satisfied?
[NOTICE] Bug fixes or features added to Salt require tests.
event_idso I did not updateCommits signed with GPG?
No
Please review Salt's Contributing Guide for best practices.
See GitHub's page on GPG signing for more information about signing commits with GPG.