2 from sipb_xen_database import *
7 def expandLocker(name):
8 groups = getafsgroups.getLockerAcl(name)
9 cell = getafsgroups.getCell(name)
13 ans.update(getafsgroups.getAfsGroupMembers(group, cell))
19 p = subprocess.Popen(['vos', 'examine', 'user.'+name],
20 stdout=subprocess.PIPE, stderr=subprocess.PIPE)
31 return getafsgroups.getAfsGroupMembers(name, 'athena.mit.edu')
33 if __name__ == '__main__':
34 connect('postgres://sipb-xen@sipb-xen-dev/sipb_xen')
36 transaction = ctx.current.create_transaction()
38 print repr(ctx), repr(ctx.current), repr(transaction)
39 # Remove existing machine access entries
40 machine_access_table.delete()
44 machines = Machine.select()
47 people.update(expandLocker(m.owner))
48 people.update(expandName(m.administrator))
49 print '%s: %s' % (m.name, ' '.join(people))
51 ma = MachineAccess(machine_id=m.machine_id, user=p)
55 # Atomically execute our changes
58 # Failed! Rollback all the changes.
59 transaction.rollback()