-
-
Notifications
You must be signed in to change notification settings - Fork 366
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Test for and fix status_set("ALARM")
; update code and docs on correct Numeric format usage
#2812
Merged
jimklimov
merged 11 commits into
networkupstools:master
from
jimklimov:issue-2708-spaces
Feb 24, 2025
Merged
Test for and fix status_set("ALARM")
; update code and docs on correct Numeric format usage
#2812
jimklimov
merged 11 commits into
networkupstools:master
from
jimklimov:issue-2708-spaces
Feb 24, 2025
Conversation
This file contains 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
…some drivers do for readability [networkupstools#2801, networkupstools#2708] Signed-off-by: Jim Klimov <[email protected]>
…s may still appear twice [networkupstools#2801, networkupstools#2708] Signed-off-by: Jim Klimov <[email protected]>
… #ifdef DEBUG not #if 0 [networkupstools#2801] Signed-off-by: Jim Klimov <[email protected]>
… would not appear twice: delay status_set("ALARM") effect and make it reasonable [networkupstools#2801, networkupstools#2708] Signed-off-by: Jim Klimov <[email protected]>
…RM") cases to set the ups.status token [networkupstools#2801, networkupstools#2708] Signed-off-by: Jim Klimov <[email protected]>
…") cases to automatically alarm_commit() if the injected value is all the alarm we have [networkupstools#2801, networkupstools#2708] Signed-off-by: Jim Klimov <[email protected]>
…to convey date/time [networkupstools#2807] Signed-off-by: Jim Klimov <[email protected]>
… in NUT reported variables [networkupstools#2807] Signed-off-by: Jim Klimov <[email protected]>
…om "%g" to "%f" to match NUT naming spec [networkupstools#2807] Signed-off-by: Jim Klimov <[email protected]>
…us_set("ALARM") and later proper alarm_set(), report only the content provided by the latter [networkupstools#2801, networkupstools#2708] Signed-off-by: Jim Klimov <[email protected]>
db1d4dd
to
44a3f26
Compare
… not status_set() nonstandard values [networkupstools#2708] Signed-off-by: Jim Klimov <[email protected]>
44a3f26
to
667d257
Compare
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Labels
bug
C-str
Issues and PRs about C/C++ methods, headers and data types dealing with strings and memory blocks
documentation
enhancement
NUT protocols
portability
We want NUT to build and run everywhere possible
refactor/fightwarn
PR or issue proposal to improve code maintainability without functional changes, or to fix warnings
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.
Work on status vs. alarms follows up from PR #2801 for issue #2708 : I've followed up on
status_commit()
unilaterally prependingALARM
to theups.status
string - and indeed, duplicates were possible in this manner (if someone wouldstatus_set("ALARM")
during the cycle; notably noups.alarm
value got assigned in such use-case but an ALARM status became present). The series of commits confirm the existing (buggy) status-quo in unit-tests, then fix it (and the tests) to assign an alarm value"[N/A]"
if none other is set yet, and expose it when westatus_commit()
.While in-tree drivers should not do
status_set("ALARM")
, currently thedrivers/mge-utalk.c
actually has a hit for that situation. This fix is primarily for the benefit of sane(r) behavior of any drivers coded in forks of NUT and not yet upstreamed, as well as for any use-cases harder to track down than grepping for this command string (crafted via mapping tables or resource files like DMF eventually).Formatting spec originated from discussion in #2807