Changeset 841 for trunk/packages/sipb-xen-console/files/usr/bin
- Timestamp:
- Aug 3, 2008, 1:01:49 AM (16 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
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.