nics primary key should be mac address, not hostname.
authorEric Price <ecprice@mit.edu>
Sat, 6 Oct 2007 23:35:24 +0000 (19:35 -0400)
committerEric Price <ecprice@mit.edu>
Sat, 6 Oct 2007 23:35:24 +0000 (19:35 -0400)
svn path=/trunk/packages/sipb-xen-database/sipb-xen-database/; revision=106

sipb_xen_database/models.py

index cc4a7e9..4a6709e 100644 (file)
@@ -31,9 +31,9 @@ machine_table = Table('machines', meta,
 
 nic_table = Table('nics', meta,
        Column('machine_id', Integer, ForeignKey('machines.machine_id'), nullable=True),
-       Column('mac_addr', String, nullable=False),
+       Column('mac_addr', String, nullable=False, primary_key=True),
        Column('ip', String, nullable=False),
-       Column('hostname', String, primary_key=True, nullable=False))
+       Column('hostname', String, nullable=True))
 
 disk_table = Table('disks', meta,
        Column('machine_id', Integer, ForeignKey('machines.machine_id'), nullable=False),