projects
/
invirt/packages/invirt-web.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
For now, revert r2093-2095, which were committed by accident; I'm not
[invirt/packages/invirt-web.git]
/
code
/
xen-ips
diff --git
a/code/xen-ips
b/code/xen-ips
index
3a69a77
..
58f3078
100755
(executable)
--- a/
code/xen-ips
+++ b/
code/xen-ips
@@
-1,6
+1,6
@@
#!/usr/bin/python
import random
#!/usr/bin/python
import random
-from sipb_xen_database import *
+from invirt import database
import sys
# stolen directly from xend/server/netif.py
import sys
# stolen directly from xend/server/netif.py
@@
-37,9
+37,9
@@
def usage():
print >> sys.stderr, "USAGE: " + sys.argv[0] + " <ip>"
def addip(ip):
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=None, mac_addr=randomMAC(), ip=ip, hostname=None)
+ database.session.save(n)
+ database.session.flush()
if __name__ == '__main__':
if __name__ == '__main__':
@@
-48,5
+48,5
@@
if __name__ == '__main__':
else:
usage()
sys.exit(1)
else:
usage()
sys.exit(1)
- connect('postgres://sipb-xen@sipb-xen-dev/sipb_xen')
+ database.connect()
addip(ip)
addip(ip)