Skip to content

Commit

Permalink
Fix scrub command for non-percentage plans
Browse files Browse the repository at this point in the history
  • Loading branch information
fmoledina committed Oct 30, 2021
1 parent 5524a86 commit 62e0357
Showing 1 changed file with 13 additions and 3 deletions.
16 changes: 13 additions & 3 deletions snapraid-runner.py
Original file line number Diff line number Diff line change
Expand Up @@ -290,11 +290,21 @@ def run():

if config["scrub"]["enabled"]:
logging.info("Running scrub...")
# if using new, bad, or full, ignore older-than config option
try:
snapraid_command("scrub", {
"plan": config["scrub"]["plan"],
args_extend = {
"plan": int(config["scrub"]["plan"]),
"older-than": config["scrub"]["older-than"],
})
}
except:
args_extend = {
"plan": config["scrub"]["plan"],
}
logging.warning(
"Ignoring 'older-than' config item with scrub plan '{}'".format(
config["scrub"]["plan"]))
try:
snapraid_command("scrub", args_extend)
except subprocess.CalledProcessError as e:
logging.error(e)
finish(False)
Expand Down

0 comments on commit 62e0357

Please sign in to comment.