Changeset 1013 for trunk/packages/sipb-xen-www/code/cache_acls.py
- Timestamp:
- Oct 3, 2008, 7:26:43 PM (16 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/packages/sipb-xen-www/code/cache_acls.py
r879 r1013 46 46 for removed in old_people - people: 47 47 ma = [x for x in m.acl if x.user == removed][0] 48 ctx.current.delete(ma)48 session.delete(ma) 49 49 for p in people - old_people: 50 50 ma = MachineAccess(user=p) 51 51 m.acl.append(ma) 52 ctx.current.save(ma)52 session.save_or_update(ma) 53 53 54 54 def refreshCache(): 55 transaction = ctx.current.create_transaction()55 session.begin() 56 56 57 57 try: … … 59 59 for m in machines: 60 60 refreshMachine(m) 61 ctx.current.flush()61 session.flush() 62 62 63 63 # Atomically execute our changes 64 transaction.commit()64 session.commit() 65 65 except: 66 66 # Failed! Rollback all the changes. 67 transaction.rollback()67 session.rollback() 68 68 raise 69 69
Note: See TracChangeset
for help on using the changeset viewer.