Ignore:
Timestamp:
Oct 6, 2007, 8:03:11 PM (17 years ago)
Author:
ecprice
Message:

Make ip unique, and constructor for nics.

File:
1 edited

Legend:

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

    r106 r107  
    3333       Column('machine_id', Integer, ForeignKey('machines.machine_id'), nullable=True),
    3434       Column('mac_addr', String, nullable=False, primary_key=True),
    35        Column('ip', String, nullable=False),
     35       Column('ip', String, nullable=False, unique=True),
    3636       Column('hostname', String, nullable=True))
    3737
     
    5555
    5656class NIC(object):
    57     pass
     57    def __init__(self, machine_id, mac_addr, ip, hostname):
     58        self.machine_id = machine_id
     59        self.mac_addr = mac_addr
     60        self.ip = ip
     61        self.hostname = hostname
    5862
    5963class Disk(object):
Note: See TracChangeset for help on using the changeset viewer.