From 3485ed10fe2362bee5037824d9ab22997a75784c Mon Sep 17 00:00:00 2001 From: Chronial Date: Sat, 15 Feb 2014 08:34:43 +0100 Subject: [PATCH] some documentation --- snapraid-runner.conf | 4 ---- snapraid-runner.py | 8 ++++++++ 2 files changed, 8 insertions(+), 4 deletions(-) diff --git a/snapraid-runner.conf b/snapraid-runner.conf index f877458..9ea73d7 100644 --- a/snapraid-runner.conf +++ b/snapraid-runner.conf @@ -27,7 +27,3 @@ port = ssl = false user = password = - - - -; maybe some smartctrl options diff --git a/snapraid-runner.py b/snapraid-runner.py index 2362568..042fdaa 100644 --- a/snapraid-runner.py +++ b/snapraid-runner.py @@ -17,6 +17,10 @@ email_log = None def tee_log(infile, out_lines, log_level): + """ + Create a thread thot saves all the output on infile to out_lines and + logs every line with log_level + """ def tee_thread(): for line in iter(infile.readline, ""): logging.log(log_level, line.strip()) @@ -29,6 +33,10 @@ def tee_log(infile, out_lines, log_level): def snapraid_command(command): + """ + Run snapraid command + Raises subprocess.CalledProcessError if errorlevel != 0 + """ p = subprocess.Popen( [config["snapraid"]["executable"], command, "--conf", config["snapraid"]["config"]],