Commit c91210bf authored by HERBERT Ryan's avatar HERBERT Ryan

modules/ fix inverted disk space test

check for available disk space test was wrong and returning the opposite
of the desired result
parent ee8bab45
......@@ -418,9 +418,9 @@ def check_enough_space(directory):
device, size, used, available, percent, mountpoint = output.split("\n")[1].split()
available = int(available)
size = int(size)
result = available < (size * (defs.FS_LOCK_THRESHHOLD/100))
if not result:
subject="[Vidjil] Server space",
message="The space in directory %s has passed below %d\%." % directory, defs.FS_LOCK_THRESHHOLD)
result = available >= (size * (defs.FS_LOCK_THRESHHOLD/100))
return result
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment