From 716d30bc5214baf3b6c6e90891298df375fb6047 Mon Sep 17 00:00:00 2001 From: Chronial Date: Fri, 11 Apr 2014 10:21:04 +0100 Subject: [PATCH] clarify that the snapraid executable needs to be a file --- snapraid-runner.conf.example | 4 ++-- snapraid-runner.py | 9 +++++---- 2 files changed, 7 insertions(+), 6 deletions(-) diff --git a/snapraid-runner.conf.example b/snapraid-runner.conf.example index 419cc41..0cc615f 100644 --- a/snapraid-runner.conf.example +++ b/snapraid-runner.conf.example @@ -1,6 +1,6 @@ [snapraid] -; path to the snapraid executable -executable = +; path to the snapraid executable (e.g. /bin/snapraid) +executable = snapraid ; path to the snapraid config to be used config = snapraid.conf ; abort operation if there are more deletes than this, set to -1 to disable diff --git a/snapraid-runner.py b/snapraid-runner.py index 8c768b6..14afd88 100644 --- a/snapraid-runner.py +++ b/snapraid-runner.py @@ -217,11 +217,12 @@ def run(): logging.info("Run started") logging.info("=" * 60) - if not os.path.exists(config["snapraid"]["executable"]): - logging.error("Snapraid executable does not exist at " + - config["snapraid"]["executable"]) + if not os.path.isfile(config["snapraid"]["executable"]): + logging.error("The configured snapraid executable \"{}\" does not " + "exist or is not a file".format( + config["snapraid"]["executable"])) finish(False) - if not os.path.exists(config["snapraid"]["config"]): + if not os.path.isfile(config["snapraid"]["config"]): logging.error("Snapraid config does not exist at " + config["snapraid"]["config"]) finish(False)