Skip to content

Commit

Permalink
fs-ro: show mount point info on first line when there is only one hit (
Browse files Browse the repository at this point in the history
…#730)

Thank you for your PR!
  • Loading branch information
kbucheli authored Mar 30, 2024
1 parent 8e1f77f commit 0f1cbed
Showing 1 changed file with 7 additions and 7 deletions.
14 changes: 7 additions & 7 deletions check-plugins/fs-ro/fs-ro
Original file line number Diff line number Diff line change
Expand Up @@ -115,13 +115,13 @@ def main():

# build the message
if len(ros) > 0:
msg = '{} read-only mount {} found:\n'.format(
len(ros),
lib.txt.pluralize('point', len(ros)),
)
for item in ros:
msg += '* {}\n'.format(item)
msg = msg[:-2]
if len(ros) == 1:
msg = 'read-only mount point found: ' + ros[0]
else:
msg = '{} read-only mount points found:\n'.format(len(ros))
for item in ros:
msg += '* {}\n'.format(item)

state = STATE_WARN
else:
msg = 'Everything is ok. {} mount {} checked.'.format(cnt, lib.txt.pluralize('point', cnt))
Expand Down

0 comments on commit 0f1cbed

Please sign in to comment.