--- /dev/null
+MAX_MEMORY_TOTAL = 512
+MAX_MEMORY_SINGLE = 512
+class Owner(object):
+ def __repr__(self):
+ return "<Owner %s: ram_quota_total=%s MB ram_quota_single=%s MB>" % (self.owner_id, self.ram_quota_total, self.ram_quota_single)
+ def getQuotas(owner):
+ owner_info = Owner.query().filter_by(owner_id=owner).first()
+ if owner_info != None:
+ quota_total = owner_info.ram_quota_total
+ if quota_total == None:
+ quota_total = MAX_MEMORY_TOTAL
+ quota_single = owner_info.ram_quota_single
+ if quota_single == None:
+ quota_single = MAX_MEMORY_SINGLE
+ else:
+ quota_total = MAX_MEMORY_TOTAL
+ quota_single = MAX_MEMORY_SINGLE
+ return (quota_total, quota_single)
+ getQuotas = staticmethod(getQuotas)