Fix RemConfFS - add code to list acl/ and update for new SQLAlchemy sipb-xen-remote-server/0.9
authorEvan Broder <broder@mit.edu>
Wed, 1 Oct 2008 23:29:06 +0000 (19:29 -0400)
committerEvan Broder <broder@mit.edu>
Wed, 1 Oct 2008 23:29:06 +0000 (19:29 -0400)
svn path=/trunk/packages/sipb-xen-remote-server/; revision=986

debian/changelog
files/usr/sbin/sipb-xen-remconffs

index a423033..978b39b 100644 (file)
@@ -1,3 +1,10 @@
+sipb-xen-remote-server (0.9) unstable; urgency=low
+
+  * Make the acl/ subdir of RemConfFS listable
+  * Update RemConfFS for new SQLAlchemy code
+
+ -- Evan Broder <broder@mit.edu>  Wed, 01 Oct 2008 19:28:23 -0400
+
 sipb-xen-remote-server (0.8) unstable; urgency=low
 
   * Use RouteFS for RemConfFS
 sipb-xen-remote-server (0.8) unstable; urgency=low
 
   * Use RouteFS for RemConfFS
index 4db1414..3f640fc 100755 (executable)
@@ -20,9 +20,6 @@ class RemConfFS(routefs.RouteFS):
        `-- conf
         
        The machine list and the acls are drawn from a database.
        `-- conf
         
        The machine list and the acls are drawn from a database.
-       
-       This filesystem only implements the getattr, getdir, read, and readlink
-       calls, because this is a read-only filesystem.
        """
        
        def __init__(self, *args, **kw):
        """
        
        def __init__(self, *args, **kw):
@@ -40,6 +37,7 @@ class RemConfFS(routefs.RouteFS):
         def make_map(self):
                 m = Mapper()
                 m.connect('', controller='getroot')
         def make_map(self):
                 m = Mapper()
                 m.connect('', controller='getroot')
+                m.connect('acl', controller='getmachines')
                 m.connect('acl/:machine', controller='getacl')
                 m.connect('conf', controller='getconf')
                 return m
                 m.connect('acl/:machine', controller='getacl')
                 m.connect('conf', controller='getconf')
                 return m
@@ -62,15 +60,15 @@ class RemConfFS(routefs.RouteFS):
                return '\n'.join("control %s /usr/sbin/sipb-xen-remote-proxy-control"
                                 " /etc/remctl/remconffs/acl/%s"
                                 % (machine_name, machine_name)
                return '\n'.join("control %s /usr/sbin/sipb-xen-remote-proxy-control"
                                 " /etc/remctl/remconffs/acl/%s"
                                 % (machine_name, machine_name)
-                                for machine_name in self.getMachines())+'\n'
+                                for machine_name in self.getmachines())+'\n'
        
        
-       def getMachines(self):
+       def getmachines(self, **kw):
                """Get the list of VMs in the database, clearing the cache if it's 
                older than 15 seconds"""
                if time() - self.lasttime > 15:
                        self.lasttime = time()
                        database.clear_cache()
                """Get the list of VMs in the database, clearing the cache if it's 
                older than 15 seconds"""
                if time() - self.lasttime > 15:
                        self.lasttime = time()
                        database.clear_cache()
-               return [machine.name for machine in database.Machine.select()]
+               return [machine.name for machine in database.session.query(database.Machine).all()]
         
        def userToPrinc(self, user):
                """Convert Kerberos v4-style names to v5-style and append a default
         
        def userToPrinc(self, user):
                """Convert Kerberos v4-style names to v5-style and append a default