+ getMemoryQuotas = staticmethod(getMemoryQuotas)
+ def getDiskQuotas(owner):
+ owner_info = Owner.query().filter_by(owner_id=owner).first()
+ if owner_info != None:
+ quota_total = owner_info.disk_quota_total
+ if quota_total == None:
+ quota_total = MAX_DISK_TOTAL
+ quota_single = owner_info.disk_quota_single
+ if quota_single == None:
+ quota_single = MAX_DISK_SINGLE
+ else:
+ quota_total = MAX_DISK_TOTAL
+ quota_single = MAX_DISK_SINGLE
+ return (quota_total, quota_single)
+ getDiskQuotas = staticmethod(getDiskQuotas)
+ def getVMQuotas(owner):
+ owner_info = Owner.query().filter_by(owner_id=owner).first()
+ if owner_info != None:
+ quota_total = owner_info.vms_quota_total
+ if quota_total == None:
+ quota_total = MAX_VMS_TOTAL
+ quota_active = owner_info.vms_quota_active
+ if quota_active == None:
+ quota_active = MAX_VMS_ACTIVE
+ else:
+ quota_total = MAX_VMS_TOTAL
+ quota_single = MAX_VMS_ACTIVE
+ return (quota_total, quota_active)
+ getVMQuotas = staticmethod(getVMQuotas)