Changeset 2191 for trunk/packages/invirt-database/python/database/owner.py
- Timestamp:
- Feb 26, 2009, 11:09:28 PM (16 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/packages/invirt-database/python/database/owner.py
r2187 r2191 16 16 _identity_field = 'owner_id' 17 17 18 def getMemoryQuotas(owner): 19 owner_info = Owner.query().filter_by(owner_id=owner).first() 18 @classmethod 19 def getMemoryQuotas(cls, owner): 20 owner_info = cls.query().filter_by(owner_id=owner).first() 20 21 if owner_info == None: 21 owner_info = Owner(owner_id=owner)22 owner_info = cls(owner_id=owner) 22 23 return (owner_info.get('ram_quota_total'), owner_info.get('ram_quota_single')) 23 getMemoryQuotas = staticmethod(getMemoryQuotas)24 24 25 def getDiskQuotas(owner): 26 owner_info = Owner.query().filter_by(owner_id=owner).first() 25 @classmethod 26 def getDiskQuotas(cls, owner): 27 owner_info = cls.query().filter_by(owner_id=owner).first() 27 28 if owner_info == None: 28 owner_info = Owner(owner_id=owner)29 owner_info = cls(owner_id=owner) 29 30 return (owner_info.get('disk_quota_total'), owner_info.get('disk_quota_single')) 30 getDiskQuotas = staticmethod(getDiskQuotas)31 31 32 def getVMQuotas(owner): 33 owner_info = Owner.query().filter_by(owner_id=owner).first() 32 @classmethod 33 def getVMQuotas(cls, owner): 34 owner_info = cls.query().filter_by(owner_id=owner).first() 34 35 if owner_info == None: 35 owner_info = Owner(owner_id=owner)36 owner_info = cls(owner_id=owner) 36 37 return (owner_info.get('vms_quota_total'), owner_info.get('vms_quota_active')) 37 getVMQuotas = staticmethod(getVMQuotas)38 39 def _ignore(self):40 return super(Owner, self)._ignore() + ['getMemoryQuotas', 'getDiskQuotas', 'getVMQuotas']
Note: See TracChangeset
for help on using the changeset viewer.