from webcommon import InvalidInput, CodeError, State
import controls
from getafsgroups import getAfsGroupMembers
-import sipb_xen_database as database
-from sipb_xen_database import Machine, CDROM, ctx, connect, MachineAccess, Type, Autoinstall
+from invirt import database
+from invirt.database import Machine, CDROM, ctx, connect, MachineAccess, Type, Autoinstall
from invirt.config import structs as config
def pathSplit(path):
import getafsgroups
import re
import string
-from sipb_xen_database import Machine, NIC, Type, Disk, CDROM, Autoinstall
+from invirt.database import Machine, NIC, Type, Disk, CDROM, Autoinstall
from webcommon import InvalidInput
MAX_MEMORY_TOTAL = 512
#!/usr/bin/python
import random
-from sipb_xen_database import *
+from invirt import database
import sys
# stolen directly from xend/server/netif.py
print >> sys.stderr, "USAGE: " + sys.argv[0] + " <ip>"
def addip(ip):
- n = NIC(machine_id=None, mac_addr=randomMAC(), ip=ip, hostname=None)
- ctx.current.save(n)
- ctx.current.flush()
+ n = database.NIC(machine_id=None, mac_addr=randomMAC(), ip=ip, hostname=None)
+ database.ctx.current.save(n)
+ database.ctx.current.flush()
if __name__ == '__main__':
else:
usage()
sys.exit(1)
- connect('postgres://sipb-xen@sipb-xen-dev/sipb_xen')
+ database.connect()
addip(ip)