Index: trunk/packages/sipb-xen-www/code/cache_acls.py
===================================================================
--- trunk/packages/sipb-xen-www/code/cache_acls.py	(revision 861)
+++ trunk/packages/sipb-xen-www/code/cache_acls.py	(revision 863)
@@ -1,4 +1,4 @@
 #!/usr/bin/python
-from sipb_xen_database import *
+from invirt.database import *
 import sys
 import getafsgroups
@@ -68,4 +68,4 @@
 
 if __name__ == '__main__':
-    connect('postgres://sipb-xen@sipb-xen-dev/sipb_xen')
+    connect()
     refreshCache()
Index: trunk/packages/sipb-xen-www/code/controls.py
===================================================================
--- trunk/packages/sipb-xen-www/code/controls.py	(revision 861)
+++ trunk/packages/sipb-xen-www/code/controls.py	(revision 863)
@@ -3,5 +3,4 @@
 """
 
-from sipb_xen_database import Machine, Disk, Type, NIC, CDROM, ctx, meta
 import validation
 from webcommon import CodeError, InvalidInput
@@ -14,4 +13,7 @@
 import yaml
 
+from invirt.config import structs as config
+from invirt.database import Machine, Disk, Type, NIC, CDROM, ctx, meta
+
 # ... and stolen from xend/uuid.py
 def randomUUID():
@@ -26,8 +28,8 @@
 # end stolen code
 
-def kinit(username = 'daemon/sipb-xen.mit.edu', keytab = '/etc/sipb-xen.keytab'):
+def kinit():
     """Kinit with a given username and keytab"""
-
-    p = subprocess.Popen(['kinit', "-k", "-t", keytab, username],
+    p = subprocess.Popen(['kinit', "-k", "-t", '/etc/invirt/keytab',
+                          'daemon/'+config.web.hostname],
                          stderr=subprocess.PIPE)
     e = p.wait()
@@ -47,5 +49,5 @@
     """
     checkKinit()
-    p = subprocess.Popen(['remctl', 'remote.mit.edu']
+    p = subprocess.Popen(['remctl', config.remote.hostname]
                          + list(args),
                          stdout=subprocess.PIPE,
Index: trunk/packages/sipb-xen-www/code/main.py
===================================================================
--- trunk/packages/sipb-xen-www/code/main.py	(revision 861)
+++ trunk/packages/sipb-xen-www/code/main.py	(revision 863)
@@ -35,6 +35,4 @@
 import templates
 from Cheetah.Template import Template
-import sipb_xen_database
-from sipb_xen_database import Machine, CDROM, ctx, connect, MachineAccess, Type, Autoinstall
 import validation
 import cache_acls
@@ -42,6 +40,8 @@
 import controls
 from getafsgroups import getAfsGroupMembers
-import invirt.config
-invirt_config = invirt.config.load()
+import sipb_xen_database
+from invirt import database
+from sipb_xen_database import Machine, CDROM, ctx, connect, MachineAccess, Type, Autoinstall
+from invirt.config import structs as config
 
 def pathSplit(path):
@@ -260,6 +260,5 @@
     host = controls.listHost(machine)
     if host:
-        port = 10003 + [config_host["hostname"] for config_host in invirt_config["hosts"]
-            ].index(host)
+        port = 10003 + [h.hostname for h in config.hosts].index(host)
     else:
         port = 5900 # dummy
@@ -285,5 +284,5 @@
         return nic.hostname
     elif nic.machine:
-        return nic.machine.name + '.xvm.mit.edu'
+        return nic.machine.name + '.' + config.dns.domains[0]
     else:
         return None
@@ -442,6 +441,6 @@
 ParaVM machines do not support local console access over VNC.  To
 access the serial console of these machines, you can SSH with Kerberos
-to console.xvm.mit.edu, using the name of the machine as your
-username.""",
+to console.%s, using the name of the machine as your
+username.""" % config.dns.domains[0],
                     'HVM/ParaVM': """
 HVM machines use the virtualization features of the processor, while
@@ -632,11 +631,11 @@
     import subprocess
 
-    to = 'xvm@mit.edu'
+    to = config.web.errormail
     mail = """To: %s
-From: root@xvm.mit.edu
+From: root@%s
 Subject: %s
 
 %s
-""" % (to, subject, body)
+""" % (to, config.web.hostname, subject, body)
     p = subprocess.Popen(['/usr/sbin/sendmail', to], stdin=subprocess.PIPE)
     p.stdin.write(mail)
@@ -733,5 +732,5 @@
 
 def constructor():
-    connect('postgres://sipb-xen@sipb-xen-dev.mit.edu/sipb_xen')
+    connect()
     return App
 
