- sipb_xen_database -> invirt.database
[invirt/packages/invirt-remote.git] / files / usr / sbin / sipb-xen-remconffs
index df07f54..0f94a94 100755 (executable)
@@ -12,7 +12,8 @@ import errno   # for error number codes (ENOENT, etc)
 
 from syslog import *
 
-import sipb_xen_database
+from invirt import database
+from invirt.config import structs as config
 
 fuse.fuse_python_api = (0, 2)
 
@@ -92,13 +93,13 @@ class RemConfFS(Fuse):
                older than 15 seconds"""
                if time() - self.lasttime > 15:
                        self.lasttime = time()
-                       sipb_xen_database.clear_cache()
-               return [machine.name for machine in sipb_xen_database.Machine.select()]
+                       database.clear_cache()
+               return [machine.name for machine in database.Machine.select()]
                
        def getacl(self, machine_name):
                """Build the ACL file for a machine
                """
-               machine = sipb_xen_database.Machine.get_by(name=machine_name)
+               machine = database.Machine.get_by(name=machine_name)
                users = [acl.user for acl in machine.acl]
                return "\n".join(map(self.userToPrinc, users)
                                 + ['include /etc/remctl/acl/web',
@@ -120,7 +121,7 @@ class RemConfFS(Fuse):
                        (princ, realm) = user.split('@')
                else:
                        princ = user
-                       realm = "ATHENA.MIT.EDU"
+                       realm = config.authn[0].realm
                
                return princ.replace('.', '/') + '@' + realm
        
@@ -227,7 +228,7 @@ class RemConfFS(Fuse):
 
 
 if __name__ == '__main__':
-       sipb_xen_database.connect('postgres://sipb-xen@sipb-xen-dev.mit.edu/sipb_xen')
+       database.connect()
        usage="""
 $0 [mount_path]
 """