Skip to content

Fix TypeError when beacons.list returns None in beacon state functions#69422

Open
Federicorao wants to merge 3 commits into
saltstack:3006.xfrom
Federicorao:codex/issue-66440-1781215354
Open

Fix TypeError when beacons.list returns None in beacon state functions#69422
Federicorao wants to merge 3 commits into
saltstack:3006.xfrom
Federicorao:codex/issue-66440-1781215354

Conversation

@Federicorao

Copy link
Copy Markdown

Fixes #66440.

What changed

Fix TypeError when beacons.list returns None in beacon state functions

Why

The issue reports that beacon.present crashes with TypeError: argument of type 'NoneType' is not iterable when beacons.list returns None, which can happen when the event system fails. The fix adds a None check on the return value of beacons.list in all four beacon state functions (present, absent, enabled, disabled) and defaults to an empty dict, which is safe to iterate over. This addresses the root cause without adding retry logic, which would be a larger feature change.

Verification

  • python ast parse passed

Not run

  • Repository runtime tests were not run outside the configured static/sandbox policy.

Changed files

  • salt/states/beacon.py
  • tests/pytests/unit/states/test_beacon.py

@Federicorao Federicorao requested a review from a team as a code owner June 11, 2026 22:04
@dwoz dwoz added the test:full Run the full test suite label Jun 12, 2026
@dwoz dwoz added this to the Potassium v3009.0 milestone Jun 12, 2026
@dwoz dwoz changed the base branch from master to 3006.x June 14, 2026 00:56
@dwoz dwoz force-pushed the codex/issue-66440-1781215354 branch from 539c7d8 to de5181f Compare June 14, 2026 01:38
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.

[BUG] beacon.present state TypeError traceback

2 participants