Skip to content

Commit

Permalink
clarify that the snapraid executable needs to be a file
Browse files Browse the repository at this point in the history
  • Loading branch information
Chronial committed Apr 11, 2014
1 parent 45e0365 commit 716d30b
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 6 deletions.
4 changes: 2 additions & 2 deletions snapraid-runner.conf.example
Original file line number Diff line number Diff line change
@@ -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
Expand Down
9 changes: 5 additions & 4 deletions snapraid-runner.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down

1 comment on commit 716d30b

@Sam-Martin
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for creating this @Chronial! We're using this in the Chef SnapRAID community cookbook at X0nic/chef-snapraid

Please sign in to comment.