Skip to content

Add wait_for_power + rebooted state for BMC-managed hosts - #2

Open
dwoz wants to merge 2 commits into
mainfrom
feat/wait-for-power-rebooted
Open

Add wait_for_power + rebooted state for BMC-managed hosts#2
dwoz wants to merge 2 commits into
mainfrom
feat/wait-for-power-rebooted

Conversation

@dwoz

@dwoz dwoz commented Jun 19, 2026

Copy link
Copy Markdown
Contributor

Lets an SLS file gate further work on a remote BMC-managed host actually coming back after a reset, instead of fire-and-forget. The new state issues a reset, polls the BMC until power returns to 'on', and optionally TCP-probes an OS-side host:port (typically SSH) before declaring success. Transient errors during the BMC's restart (TLS resets, 401s while the web stack restarts) are absorbed and retried instead of aborting the wait.

Exposed in both targeting styles:

  • bmc.wait_for_power / bmc.rebooted (profile-based)
  • bmc_host.wait_for_power / bmc_host.rebooted (resource-based)

Lets an SLS file gate further work on a remote BMC-managed host actually
coming back after a reset, instead of fire-and-forget. The new state
issues a reset, polls the BMC until power returns to 'on', and
optionally TCP-probes an OS-side host:port (typically SSH) before
declaring success. Transient errors during the BMC's restart (TLS
resets, 401s while the web stack restarts) are absorbed and retried
instead of aborting the wait.

Exposed in both targeting styles:
- bmc.wait_for_power / bmc.rebooted (profile-based)
- bmc_host.wait_for_power / bmc_host.rebooted (resource-based)

Includes a new "Rebooting BMC-managed hosts" topic guide and an
autodoc reference page for the shared polling helper.
@dwoz
dwoz force-pushed the feat/wait-for-power-rebooted branch from 1744db6 to fa7618f Compare June 19, 2026 09:54
pyupgrade rewrote socket.error to OSError in test_tcp_probe_failure,
leaving 'import socket' unused.
@codecov

codecov Bot commented Jun 20, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 98.73950% with 3 lines in your changes missing coverage. Please review.
✅ Project coverage is 85.18%. Comparing base (fc4201c) to head (5b8400b).
⚠️ Report is 1 commits behind head on main.

Files with missing lines Patch % Lines
src/saltext/bmc/states/bmc.py 90.90% 1 Missing and 2 partials ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main       #2      +/-   ##
==========================================
+ Coverage   82.78%   85.18%   +2.39%     
==========================================
  Files          17       19       +2     
  Lines        1348     1586     +238     
  Branches       98      108      +10     
==========================================
+ Hits         1116     1351     +235     
- Misses        200      201       +1     
- Partials       32       34       +2     
Flag Coverage Δ
Linux 85.18% <98.73%> (+2.39%) ⬆️
macOS 85.11% <98.73%> (+2.40%) ⬆️
project 81.81% <95.77%> (+1.46%) ⬆️
py311 85.11% <98.73%> (+2.40%) ⬆️
py314 85.18% <98.73%> (+2.39%) ⬆️
salt_3008_0rc1 85.18% <98.73%> (+2.39%) ⬆️
tests 88.18% <100.00%> (+2.94%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant