2 from invirt.database import *
3 from invirt.config import structs as config
8 def expandLocker(name):
9 groups = getafsgroups.getLockerAcl(name)
10 cell = getafsgroups.getCell(name)
14 ans.update(getafsgroups.getAfsGroupMembers(group, cell))
20 p = subprocess.Popen(['vos', 'examine', 'user.'+name],
21 stdout=subprocess.PIPE, stderr=subprocess.PIPE)
33 return getafsgroups.getAfsGroupMembers(name, config.authz[0].cell)
34 except getafsgroups.AfsProcessError:
39 people.update(expandLocker(m.owner))
40 people.update(expandName(m.administrator))
43 def refreshMachine(m):
44 people = accessList(m)
45 old_people = set(a.user for a in m.acl)
46 for removed in old_people - people:
47 ma = [x for x in m.acl if x.user == removed][0]
49 for p in people - old_people:
50 ma = MachineAccess(user=p)
52 session.save_or_update(ma)
58 machines = Machine.select()
63 # Atomically execute our changes
66 # Failed! Rollback all the changes.
70 if __name__ == '__main__':