mirror of
https://github.com/vale981/dirkules
synced 2025-03-05 09:21:38 -05:00
clean up
This commit is contained in:
parent
c3f8aec018
commit
1b4e51d28c
2 changed files with 7 additions and 9 deletions
|
@ -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()
|
||||
|
|
|
@ -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):
|
||||
|
|
Loading…
Add table
Reference in a new issue