From 751aa520781a12c35b65b6f5f1b485f2548b7e3e Mon Sep 17 00:00:00 2001 From: Eric Price Date: Fri, 6 Jun 2008 12:01:28 -0400 Subject: [PATCH] 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 --- code/cache_acls.py | 3 ++- code/controls.py | 2 -- 2 files changed, 2 insertions(+), 3 deletions(-) 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: -- 1.7.9.5