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

Made some changes requested by Broder.

Location:
trunk/packages/invirt-database/python/database
Files:
2 edited

Legend:

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

    r2134 r2135  
    55from sqlalchemy.ext.sessioncontext import SessionContext
    66from sqlalchemy.ext.assignmapper import assign_mapper
     7
     8from owner import Owner
    79
    810__all__ = ['meta',
     
    131133        return "<Autoinstall %s: %s (%s)>" % (self.autoinstall_id, self.description, self.type.type_id)
    132134
    133 from owner import Owner
    134 
    135135session.mapper(Machine, machine_table,
    136136              properties={'nics': relation(NIC, backref="machine"),
  • trunk/packages/invirt-database/python/database/owner.py

    r2134 r2135  
    1010        return """<Owner %s: ram_quota_total=%s MB ram_quota_single=%s MB
    1111disk_quota_total=%s MB disk_quota_single=%s MB
    12 vms_quota_total=%s vms_quota_active=%s >""" % (self.owner_id, self.ram_quota_total, self.ram_quota_single, self.disk_quota_total, self.disk_quota_single, self.vms_quota_total, self.vms_quota_active)
     12vms_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)
    1319    def getMemoryQuotas(owner):
    1420        owner_info = Owner.query().filter_by(owner_id=owner).first()
Note: See TracChangeset for help on using the changeset viewer.