Changeset 2143


Ignore:
Timestamp:
Feb 17, 2009, 2:54:57 AM (16 years ago)
Author:
iannucci
Message:

Fixed yasb

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/packages/invirt-database/python/database/owner.py

    r2142 r2143  
    88class Owner(object):
    99    def __repr__(self):
     10        a = self.ram_quota_total
     11        b = self.ram_quota_single
     12        c = self.disk_quota_total
     13        d = self.disk_quota_single
     14        e = self.vms_quota_total
     15        f = self.vms_quota_active
     16        if not a:
     17            a = MAX_MEMORY_TOTAL
     18        if not b:
     19            b = MAX_MEMORY_SINGLE
     20        if not c:
     21            c = MAX_DISK_TOTAL
     22        if not d:
     23            d = MAX_DISK_SINGLE
     24        if not e:
     25            e = MAX_VMS_TOTAL
     26        if not f:
     27            f = MAX_VMS_ACTIVE
    1028        return """<Owner %s: ram_quota_total=%s MB ram_quota_single=%s MB
    1129disk_quota_total=%s MB disk_quota_single=%s MB
    12 vms_quota_total=%s vms_quota_active=%s >""" % (self.owner_id,
    13                self.ram_quota_total if self.ram_quota_total else MAX_MEMORY_TOTAL,
    14                self.ram_quota_single if self.ram_quota_single else MAX_MEMORY_SINGLE,
    15                self.disk_quota_total if self.disk_quota_total else MAX_DISK_TOTAL,
    16                self.disk_quota_single if self.disk_quota_single else MAX_DISK_SINGLE,
    17                self.vms_quota_total if self.vms_quota_total else MAX_VMS_TOTAL,
    18                self.vms_quota_active if self.vms_quota_active else MAX_VMS_ACTIVE)
     30vms_quota_total=%s vms_quota_active=%s >""" % (self.owner_id, a,b,c,d,e,f)
    1931    def getMemoryQuotas(owner):
    2032        owner_info = Owner.query().filter_by(owner_id=owner).first()
Note: See TracChangeset for help on using the changeset viewer.