From c3b64b767d1eec777ffd771f341006d5b5a8f4cc Mon Sep 17 00:00:00 2001 From: Benjamin Renard Date: Tue, 19 Dec 2023 13:50:32 +0100 Subject: [PATCH] Improve output when filtering devices --- check_syncthing | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/check_syncthing b/check_syncthing index 3cad2e9..68ca0d9 100755 --- a/check_syncthing +++ b/check_syncthing @@ -173,6 +173,10 @@ for folder in config["folders"]: share_with = [ devices[dev["deviceID"]] for dev in folder["devices"] if dev["deviceID"] in devices ] + if not share_with: + if args.devices or args.excluded_devices: + continue + share_with = ["no device"] extra_lines.append( f"- {folder['label']} ({folder['path']}, share with {', '.join(share_with)})" ) @@ -209,3 +213,5 @@ else: print(" - ".join(status)) print("\n".join(extra_lines)) sys.exit(exit_status[error_level]) + +# vim: tabstop=4 shiftwidth=4 softtabstop=4 expandtab