This commit is contained in:
Daniel 2019-09-20 13:35:53 +02:00
parent c3f8aec018
commit 1b4e51d28c
2 changed files with 7 additions and 9 deletions

View file

@ -123,6 +123,12 @@ def pool_gen():
def get_pool_health(drive_list):
"""
:param drive_list: contains drives which belongs to pool
:type drive_list: list
:return: the total health of the pool, based on drives health
:rtype: boolean
"""
drive_split = drive_list.split(",")
for drive in drive_split:
db_drive = db.session.query(Drive).filter(Drive.name == drive).scalar()

View file

@ -1,15 +1,7 @@
# -*- coding: utf-8 -*-
from sqlalchemy import inspect
from dirkules import db
from dirkules.hardware.btrfsTools import create_pool
from dirkules.models import Cleaning, Partitions, Drive
def db_object_as_dict(obj):
return {
c.key: getattr(obj, c.key)
for c in inspect(obj).mapper.column_attrs
}
from dirkules.models import Cleaning, Drive
def create_cleaning_obj(jobname, path, active):