Skip to content

Fix requisite_in crash with exclude and a *_in requisite (#57999)#69778

Open
ggiesen wants to merge 2 commits into
saltstack:3006.xfrom
ggiesen:fix-57999-exclude-id
Open

Fix requisite_in crash with exclude and a *_in requisite (#57999)#69778
ggiesen wants to merge 2 commits into
saltstack:3006.xfrom
ggiesen:fix-57999-exclude-id

Conversation

@ggiesen

@ggiesen ggiesen commented Jul 11, 2026

Copy link
Copy Markdown
Contributor

What does this PR do?

Fixes a state compiler crash: requisite_in raised AttributeError: 'OrderedDict' object has no attribute 'startswith' when an exclude was combined with a *_in requisite whose target is a bare name not present as an id.

What issues does this PR fix or reference?

Fixes #57999

Previous Behavior

When resolving a *_in requisite (e.g. require_in, onchanges_in) whose target is a bare name not directly present as an id, requisite_in falls back to scanning every state in the high data to match on name. That scan iterated every top-level entry, including __exclude__ -- which is a list, not a state body -- and called .startswith("__") on its elements, raising:

AttributeError: 'OrderedDict' object has no attribute 'startswith'

requisite_in runs before apply_exclude, so __exclude__ is still present in the high data. Any highstate that combined an exclude (by id or sls) with such a requisite aborted with this traceback instead of compiling.

New Behavior

The fallback scan skips non-state entries such as __exclude__, matching the isinstance(body, dict) guard already used by the top-level loop in the same method. The highstate compiles normally.

Merge requirements satisfied?

  • Docs - n/a
  • Changelog - changelog/57999.fixed.md
  • Tests written/updated - test_requisite_in_with_exclude_does_not_raise (fails on current code with the reported AttributeError, passes with the fix)

Commits signed with GPG?

No

requisite_in's name-resolution fallback scan iterated every top-level entry
in the high data, including __exclude__ (a list), and called .startswith() on
each -- raising AttributeError: 'OrderedDict' object has no attribute
'startswith' whenever a *_in requisite referenced a bare name not present as
an id and an exclude was in effect.

Skip non-state entries in that scan, matching the guard already used by the
top-level requisite_in loop.

Fixes saltstack#57999
@ggiesen ggiesen requested a review from a team as a code owner July 11, 2026 15:17
@dwoz dwoz added the test:full Run the full test suite label Jul 12, 2026
@twangboy twangboy added this to the Sulphur v3006.28 milestone Jul 15, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

test:full Run the full test suite

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants