Changeset 865 for trunk/packages/sipb-xen-www/code/xen-ips
- Timestamp:
- Aug 4, 2008, 10:42:11 PM (16 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/packages/sipb-xen-www/code/xen-ips
r243 r865 1 1 #!/usr/bin/python 2 2 import random 3 from sipb_xen_database import *3 from invirt import database 4 4 import sys 5 5 … … 38 38 39 39 def addip(ip): 40 n = NIC(machine_id=None, mac_addr=randomMAC(), ip=ip, hostname=None)41 ctx.current.save(n)42 ctx.current.flush()40 n = database.NIC(machine_id=None, mac_addr=randomMAC(), ip=ip, hostname=None) 41 database.ctx.current.save(n) 42 database.ctx.current.flush() 43 43 44 44 … … 49 49 usage() 50 50 sys.exit(1) 51 connect('postgres://sipb-xen@sipb-xen-dev/sipb_xen')51 database.connect() 52 52 addip(ip)
Note: See TracChangeset
for help on using the changeset viewer.