Fix LocalClient.cmd_subset crashing on failed minion probing (#68103)#69437
Open
dwoz wants to merge 1 commit into
Open
Fix LocalClient.cmd_subset crashing on failed minion probing (#68103)#69437dwoz wants to merge 1 commit into
dwoz wants to merge 1 commit into
Conversation
cmd_subset called sys.list_functions on the targets and then iterated the response with ``if fun in minion_ret[minion]``. When a targeted minion failed to respond the LocalClient.cmd code path records that minion's value as ``False``, which made the membership test raise ``TypeError: argument of type 'bool' is not iterable``. Skip minions whose probe response is not a container so the subset loop transparently passes over failed minions instead of crashing. Fixes saltstack#68103
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What does this PR do?
Stops
LocalClient.cmd_subsetfrom raisingTypeError: argument of type 'bool' is not iterablewhen one or more targeted minions fail thesys.list_functionsprobe. Failed minions surface asFalsein the probe result and are now skipped during subset selection.What issues does this PR fix or reference?
Fixes #68103
Previous Behavior
cmd_subsetiterates the result of asys.list_functionsprobe withif fun in minion_ret[minion]. When a minion failed to respond,LocalClient.cmdrecords its entry asFalse, so the membership test raisedTypeError: argument of type 'bool' is not iterableand aborted the call:New Behavior
Failed minions (non-container probe responses) are skipped during the subset loop.
cmd_subsetreturns the subset of responsive minions and never raises on this code path.Merge requirements satisfied?
Commits signed with GPG?
Yes