Divert /etc/conserver/console.cf in the right binary package.
[invirt/packages/invirt-console.git] / server / usr / bin / invirt-consolefs
index a3f75ec..a23ae5c 100755 (executable)
@@ -46,7 +46,7 @@ class ConsoleFS(routefs.RouteFS):
         if time() - self.lasttime > 5:
             self.lasttime = time()
             database.clear_cache()
-            self.machines = dict((machine.name, machine) for machine in database.session.query(database.Machine).all())
+            self.machines = dict((machine.name, machine) for machine in database.Machine.query.all())
 
     def getMachines(self, **kw):
         self.recache()
@@ -70,8 +70,12 @@ class ConsoleFS(routefs.RouteFS):
     def getK5login(self, machine, **kw):
         self.recache()
         machine = self.machines[machine]
-        users = [acl.user for acl in machine.acl]
-        return "\n".join(map(self.userToPrinc, users) + [''])
+        users = (acl.user for acl in machine.acl)
+        users = [self.userToPrinc(u) for u in users]
+        users.append('daemon/%s@%s' % (config.web.hostname,
+                                       config.kerberos.realm))
+        users.append('')
+        return "\n".join(users)
     
     def mirrorPath(self, path):
         """Translate a virtual path to its real path counterpart"""
@@ -85,7 +89,7 @@ class ConsoleFS(routefs.RouteFS):
             (princ, realm) = user.split('@')
         else:
             princ = user
-            realm = config.authn[0].realm
+            realm = config.kerberos.realm
         
         return princ.replace('.', '/') + '@' + realm