some documentation
This commit is contained in:
1 parent
bd55a215f3
commit
3485ed10fe
2 files changed
+8
-4
No files matched your search
@@ -27,7 +27,3 @@ port =
|
|||||||
ssl = false
|
ssl = false
|
||||||
user =
|
user =
|
||||||
password =
|
password =
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
; maybe some smartctrl options
|
|
||||||
@@ -17,6 +17,10 @@ email_log = None
|
|||||||
|
|
||||||
|
|
||||||
def tee_log(infile, out_lines, log_level):
|
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():
|
def tee_thread():
|
||||||
for line in iter(infile.readline, ""):
|
for line in iter(infile.readline, ""):
|
||||||
logging.log(log_level, line.strip())
|
logging.log(log_level, line.strip())
|
||||||
@@ -29,6 +33,10 @@ def tee_log(infile, out_lines, log_level):
|
|||||||
|
|
||||||
|
|
||||||
def snapraid_command(command):
|
def snapraid_command(command):
|
||||||
|
"""
|
||||||
|
Run snapraid command
|
||||||
|
Raises subprocess.CalledProcessError if errorlevel != 0
|
||||||
|
"""
|
||||||
p = subprocess.Popen(
|
p = subprocess.Popen(
|
||||||
[config["snapraid"]["executable"], command,
|
[config["snapraid"]["executable"], command,
|
||||||
"--conf", config["snapraid"]["config"]],
|
"--conf", config["snapraid"]["config"]],
|
||||||
|
|||||||
Reference in new issue
Block a user