get db uri from invirt.config in sipb-database sipb-xen-database/10.15
authorGreg Price <price@mit.edu>
Sun, 3 Aug 2008 04:29:54 +0000 (00:29 -0400)
committerGreg Price <price@mit.edu>
Sun, 3 Aug 2008 04:29:54 +0000 (00:29 -0400)
svn path=/trunk/packages/sipb-xen-database/; revision=829

client/etc/xen/sipb-database
config.todo
debian/changelog
python/database/__init__.py

index 4153fc0..2d80d07 100644 (file)
@@ -1,11 +1,10 @@
 # -*- mode: python; -*-
 # -*- mode: python; -*-
-import sipb_xen_database.models as models
-from sipb_xen_database import connect
+from invirt.database import models, connect
 import re
 import tempfile
 from subprocess import call
 
 import re
 import tempfile
 from subprocess import call
 
-connect('postgres://sipb-xen@sipb-xen-dev.mit.edu/sipb_xen')
+connect()
 prefix = "d_"
 
 # 'machine_name', and optionally 'cdrom_image', should get passed in
 prefix = "d_"
 
 # 'machine_name', and optionally 'cdrom_image', should get passed in
index 1c7158d..b0913c1 100644 (file)
@@ -1,3 +1,2 @@
-client/etc/xen/sipb-database: db uri
 client/etc/xen/sipb-database: gateway, netmask
 sipb-xen-database-tables: db uri
 client/etc/xen/sipb-database: gateway, netmask
 sipb-xen-database-tables: db uri
index 2485a08..a271791 100644 (file)
@@ -1,8 +1,14 @@
 sipb-xen-database (10.15) unstable; urgency=low
 
 sipb-xen-database (10.15) unstable; urgency=low
 
-  * uncommitted changes to /etc/xen/sipb-database on black-mesa
+  in /etc/xen/database:
+  * uncommitted changes on black-mesa
+  * sipb_xen_database -> invirt.database
+  * use default db uri
 
 
- -- Greg Price <price@mit.edu>  Sun,  3 Aug 2008 00:26:13 -0400
+  in invirt.database:
+  * get default db uri from invirt.config
+
+ -- Greg Price <price@mit.edu>  Sun,  3 Aug 2008 00:26:46 -0400
 
 sipb-xen-database (10.14) unstable; urgency=low
 
 
 sipb-xen-database (10.14) unstable; urgency=low
 
index c247bdf..88e5169 100644 (file)
@@ -1,5 +1,6 @@
+from invirt.config import structs as config
 from models import *
 
 from models import *
 
-def connect(uri):
+def connect(uri = config.db.uri):
     """ Connect to a given database URI"""
     meta.connect(uri)
     """ Connect to a given database URI"""
     meta.connect(uri)