Skip to content

Commit 8e5b146

Browse files
committed
fix(ntp-chronyd, ntp-ntpd): SyntaxError: f-string: unmatched '(' on python 3.11 (closes #952)
1 parent 74c281b commit 8e5b146

File tree

3 files changed

+9
-5
lines changed

3 files changed

+9
-5
lines changed

CHANGELOG.md

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,11 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.1.0/).
77

88
## [Unreleased]
99

10-
tbd
10+
### Fixed ("fix")
11+
12+
Monitoring Plugins:
13+
14+
* ntp-chronyd, ntp-ntpd: SyntaxError: f-string: unmatched '(' on python 3.11 ([#952](https://github.com/Linuxfabrik/lib/issues/952))
1115

1216

1317
## [v2.2.0] - 2025-09-19

check-plugins/ntp-chronyd/ntp-chronyd

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ import lib.shell
2222
from lib.globals import (STATE_OK, STATE_UNKNOWN, STATE_WARN)
2323

2424
__author__ = 'Linuxfabrik GmbH, Zurich/Switzerland'
25-
__version__ = '2025091501'
25+
__version__ = '2025092201'
2626

2727
DESCRIPTION = '''This plugin compares the chronyd clock offset in milliseconds to that of
2828
the NTP servers.'''
@@ -157,7 +157,7 @@ def main():
157157
offset_state = lib.base.get_state(abs(last_offset), args.WARN, args.CRIT)
158158
state = lib.base.get_worst(state, offset_state)
159159
msg += f'NTP offset is {round(last_offset, 3)}ms' \
160-
f'{lib.base.state2str(offset_state, prefix=' ')}, ' \
160+
f'{lib.base.state2str(offset_state, prefix=" ")}, ' \
161161
f'Stratum is {stratum}'
162162
if stratum >= args.STRATUM:
163163
stratum_state = STATE_WARN

check-plugins/ntp-ntpd/ntp-ntpd

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ import lib.shell
2222
from lib.globals import (STATE_OK, STATE_UNKNOWN, STATE_WARN)
2323

2424
__author__ = 'Linuxfabrik GmbH, Zurich/Switzerland'
25-
__version__ = '2025091501'
25+
__version__ = '2025092201'
2626

2727
DESCRIPTION = '''This plugin checks the clock offset of ntpd in milliseconds
2828
compared to ntp servers.'''
@@ -138,7 +138,7 @@ def main():
138138
# build the message
139139
offset_state = lib.base.get_state(abs(offset), args.WARN, args.CRIT)
140140
state = lib.base.get_worst(state, offset_state)
141-
msg += f'NTP offset is {offset}ms{lib.base.state2str(offset_state, prefix=' ')}, ' \
141+
msg += f'NTP offset is {offset}ms{lib.base.state2str(offset_state, prefix=" ")}, ' \
142142
f'Stratum is {stratum}'
143143
if stratum >= args.STRATUM:
144144
stratum_state = STATE_WARN

0 commit comments

Comments
 (0)