Skip to content

Conversation

@desertwitch
Copy link
Contributor

follow up to #2931, fixes #2928
implements the ideas of #2931 (comment)

this PR amends the various involved parts to clean separation of legacy UPS-status coupled ALARM
and modern alarm_-driven ALARM, which are decoupled from UPS status aside from the token itself.

it removes making assumptions on legacy UPS-status coupled ALARM and removes workarounds trying
to port any such legacy ALARM statuses into the UPS-status decoupled alarm_ schema, because this would
mean later having to couple them back to UPS-status again to be able to exit these alarm states. (within dstate)

this PR allows for both to co-exist peacefully with the only limitation being that a ups.alarm does not get
injected when it is not otherwise published directly and manually by the (legacy) driver. ups.alarm published
manually by the (legacy) UPS driver will still raise appropriate (seperate) notifications, be tracked by upsmon
and function normally as if they were raised by the modern alarm_ functions (from the upsmon perspective).

the upsmon does not care where in dstate an ALARM token was set, nor if done so by legacy or modern method.

the tests now cover both legacy, mixed and modern scenarios respectively, as well as some more curious edge-cases.
further work is in progress to modernize the few remaining legacy drivers to use the status_ and alarm_ functions.
this ongoing work will later be published in separate PRs.

@desertwitch desertwitch marked this pull request as ready for review April 30, 2025 19:16
@desertwitch desertwitch changed the title dstate: clean separation of UPS-statused based ALARM and modern alarm_*-driven ALARMs dstate: clean separation of older UPS-status based ALARM and modern alarm_*-driven ALARM May 1, 2025
@jimklimov jimklimov added this to the 2.8.4 milestone May 6, 2025
@jimklimov jimklimov added enhancement NUT protocols impacts-release-2.8.3 Issues reported against NUT release 2.8.3 (maybe vanilla or with minor packaging tweaks) refactor/fightwarn PR or issue proposal to improve code maintainability without functional changes, or to fix warnings labels May 9, 2025
jimklimov added a commit to desertwitch/nut that referenced this pull request May 10, 2025
…set and status set+commit+set+commit (without init in the middle) adds reported tokens [networkupstools#2934]

Signed-off-by: Jim Klimov <[email protected]>
…set and status set+commit+set+commit (without init in the middle) adds reported tokens [networkupstools#2934]

Signed-off-by: Jim Klimov <[email protected]>
@jimklimov jimklimov force-pushed the issue-2928-nolegacy branch from 9a3d0e7 to c52b586 Compare May 11, 2025 14:23
@jimklimov jimklimov merged commit 8decca2 into networkupstools:master May 11, 2025
21 of 24 checks passed
@desertwitch desertwitch deleted the issue-2928-nolegacy branch May 26, 2025 08:52
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement impacts-release-2.8.3 Issues reported against NUT release 2.8.3 (maybe vanilla or with minor packaging tweaks) NUT protocols refactor/fightwarn PR or issue proposal to improve code maintainability without functional changes, or to fix warnings

Projects

None yet

Development

Successfully merging this pull request may close these issues.

dstate/dummy-ups: ALARM status does not clear after dirty entrance into state

2 participants