Commit e68b63ce by Kálmán Viktor

fix ctime error in make_free_space

parent 7de1a3f5
......@@ -119,8 +119,14 @@ def make_free_space(datastore, percent=10):
removes oldest files to satisfy the given requirement.
trash_path = path.join(datastore, trash_directory)
files = sorted(listdir(trash_path),
key=lambda x: path.getctime(path.join(trash_path, x)))
def comp(filename):
return path.getctime(path.join(trash_path, filename))
except OSError:
return 0
files = sorted(listdir(trash_path), key=comp)"Free space on datastore: %s" %
while get_storage_stat(trash_path).get('free_percent') < percent:
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 sign in to comment