From f8c61d2924ba0ede2754ca798b45c43cf75f292a Mon Sep 17 00:00:00 2001 From: Greg Price Date: Mon, 4 Aug 2008 22:42:11 -0400 Subject: [PATCH] finish sipb_xen_database -> invirt.database in web svn path=/trunk/packages/sipb-xen-www/; revision=865 --- code/main.py | 4 ++-- code/validation.py | 2 +- code/xen-ips | 10 +++++----- 3 files changed, 8 insertions(+), 8 deletions(-) diff --git a/code/main.py b/code/main.py index 8506ee5..8990e51 100755 --- a/code/main.py +++ b/code/main.py @@ -39,8 +39,8 @@ import cache_acls 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): diff --git a/code/validation.py b/code/validation.py index 04b53ba..817c2cf 100644 --- a/code/validation.py +++ b/code/validation.py @@ -4,7 +4,7 @@ import cache_acls 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 diff --git a/code/xen-ips b/code/xen-ips index 3a69a77..0af6956 100755 --- a/code/xen-ips +++ b/code/xen-ips @@ -1,6 +1,6 @@ #!/usr/bin/python import random -from sipb_xen_database import * +from invirt import database import sys # stolen directly from xend/server/netif.py @@ -37,9 +37,9 @@ def usage(): print >> sys.stderr, "USAGE: " + sys.argv[0] + " " 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__': @@ -48,5 +48,5 @@ if __name__ == '__main__': else: usage() sys.exit(1) - connect('postgres://sipb-xen@sipb-xen-dev/sipb_xen') + database.connect() addip(ip) -- 1.7.9.5