From: Eric Price Date: Fri, 6 Jun 2008 16:01:28 +0000 (-0400) Subject: Set machine_access to be a private attribute of machine, so the acl is X-Git-Tag: sipb-xen-www/3.6~53 X-Git-Url: http://xvm.mit.edu/gitweb/invirt/packages/invirt-web.git/commitdiff_plain/751aa520781a12c35b65b6f5f1b485f2548b7e3e Set machine_access to be a private attribute of machine, so the acl is deleted automatically when the machine is destroyed. svn path=/trunk/packages/sipb-xen-www/; revision=589 --- diff --git a/code/cache_acls.py b/code/cache_acls.py index b18eabc..9f8d66a 100644 --- a/code/cache_acls.py +++ b/code/cache_acls.py @@ -46,7 +46,8 @@ def refreshMachine(m): ma = [x for x in m.acl if x.user == removed][0] ctx.current.delete(ma) for p in people - old_people: - ma = MachineAccess(machine_id=m.machine_id, user=p) + ma = MachineAccess(user=p) + m.acl.append(ma) ctx.current.save(ma) def refreshCache(): diff --git a/code/controls.py b/code/controls.py index ff3691c..57107ef 100644 --- a/code/controls.py +++ b/code/controls.py @@ -196,8 +196,6 @@ def deleteVM(machine): ctx.current.save(nic) for disk in machine.disks: ctx.current.delete(disk) - for access in machine.acl: - ctx.current.delete(access) ctx.current.delete(machine) transaction.commit() except: