Fix support for non-numeric scrub plans (fixes #48)
This commit is contained in:
1 parent
5524a86f7c
commit
8ce2458e5e
3 files changed
+12
-4
No files matched your search
+9
-2
@@ -291,10 +291,17 @@ def run():
|
||||
if config["scrub"]["enabled"]:
|
||||
logging.info("Running scrub...")
|
||||
try:
|
||||
snapraid_command("scrub", {
|
||||
# Check if a percentage plan was given
|
||||
int(config["scrub"]["plan"])
|
||||
except ValueError:
|
||||
scrub_args = {"plan": config["scrub"]["plan"]}
|
||||
else:
|
||||
scrub_args = {
|
||||
"plan": config["scrub"]["plan"],
|
||||
"older-than": config["scrub"]["older-than"],
|
||||
})
|
||||
}
|
||||
try:
|
||||
snapraid_command("scrub", scrub_args)
|
||||
except subprocess.CalledProcessError as e:
|
||||
logging.error(e)
|
||||
finish(False)
|
||||
|
||||
Reference in new issue
Block a user