Ignore:
Timestamp:
Oct 7, 2007, 1:12:18 AM (17 years ago)
Author:
ecprice
Message:

Add a table for boot CDs.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/packages/sipb-xen-database/sipb-xen-database/sipb_xen_database/models.py

    r107 r108  
    1010           'disk_table',
    1111           'types_table',
     12           'cdroms_table',
    1213           'Machine',
    1314           'NIC',
    1415           'Disk',
    15            'Type']
     16           'Type',
     17           'CDROM']
    1618
    1719meta = DynamicMetaData()
     
    5052       Column('pae', Boolean, nullable=False))
    5153
     54cdroms_table = Table('cdroms', meta,
     55       Column('cdrom_id', String, primary_key=True, nullable=False),
     56       Column('description', String, nullable=False))
     57
    5258
    5359class Machine(object):
     
    6268
    6369class Disk(object):
    64     pass
     70    def __init__(self, machine_id, guest, size):
     71        self.machine_id = machine_id
     72        self.guest_device_name = guest
     73        self.size = size
    6574
    6675class Type(object):
    6776    pass
    6877
     78class CDROM(object):
     79    def __init__(self, cdrom_id, description):
     80        self.cdrom_id = cdrom_id
     81        self.description = description
    6982
    7083assign_mapper(ctx, Machine, machine_table, \
     
    7487assign_mapper(ctx, Disk, disk_table)
    7588assign_mapper(ctx, Type, types_table)
     89assign_mapper(ctx, CDROM, cdroms_table)
    7690
Note: See TracChangeset for help on using the changeset viewer.