Changeset 841 for trunk/packages
- Timestamp:
- Aug 3, 2008, 1:01:49 AM (16 years ago)
- Location:
- trunk/packages/sipb-xen-console
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/packages/sipb-xen-console/config.todo
r810 r841 1 etc/nss-pgsql.conf 2 etc/issue.net.no_tkt 3 usr/bin/sipb-xen-consolefs: realm 4 usr/bin/sipb-xen-consolefs: database 5 etc/lots: could benefit from config-package-dev TRANSFORM for upgradeability 1 files/etc/nss-pgsql.conf 2 files/etc/issue.net.no_tkt 3 files/etc/lots: could benefit from config-package-dev TRANSFORM for upgradeability -
trunk/packages/sipb-xen-console/files/usr/bin/sipb-xen-consolefs
r359 r841 13 13 from syslog import * 14 14 15 import sipb_xen_database 15 from invirt.config import structs as config 16 from invirt import database 16 17 17 18 fuse.fuse_python_api = (0, 2) … … 86 87 if time() - self.lasttime > 15: 87 88 self.lasttime = time() 88 sipb_xen_database.clear_cache()89 return [machine.name for machine in sipb_xen_database.Machine.select()]89 database.clear_cache() 90 return [machine.name for machine in database.Machine.select()] 90 91 91 92 def getUid(self, machine_name): 92 93 """Calculate the UID of a machine-account, which is just machine_id+1000 93 94 """ 94 return sipb_xen_database.Machine.get_by(name=machine_name).machine_id + 100095 return database.Machine.get_by(name=machine_name).machine_id + 1000 95 96 96 97 def getK5login(self, machine_name): 97 98 """Build the ACL for a machine and turn it into a .k5login file 98 99 """ 99 machine = sipb_xen_database.Machine.get_by(name=machine_name)100 machine = database.Machine.get_by(name=machine_name) 100 101 users = [acl.user for acl in machine.acl] 101 102 return "\n".join(map(self.userToPrinc, users) + ['']) … … 109 110 else: 110 111 princ = user 111 realm = "ATHENA.MIT.EDU"112 realm = config.authn[0].realm 112 113 113 114 return princ.replace('.', '/') + '@' + realm … … 240 241 241 242 if __name__ == '__main__': 242 sipb_xen_database.connect('postgres://sipb-xen@sipb-xen-dev.mit.edu/sipb_xen')243 database.connect() 243 244 usage=""" 244 245 ConsoleFS [mount_path]
Note: See TracChangeset
for help on using the changeset viewer.