From 77269356e0e57b5e35fec45eb5fa235dfcc821d5 Mon Sep 17 00:00:00 2001
From: Eric Price <ecprice@mit.edu>
Date: Tue, 27 Nov 2007 02:06:29 -0500
Subject: [PATCH] Makes deleting VMs work with the access controls.

svn path=/trunk/web/; revision=247
---
 controls.py |    2 ++
 main.py     |    7 +++----
 2 files changed, 5 insertions(+), 4 deletions(-)

diff --git a/controls.py b/controls.py
index 4099d3b..620402b 100644
--- a/controls.py
+++ b/controls.py
@@ -201,6 +201,8 @@ def deleteVM(machine):
             ctx.current.save(nic)
         for disk in machine.disks:
             ctx.current.delete(disk)
+        for access in machine.users:
+            ctx.current.delete(access)
         ctx.current.delete(machine)
         transaction.commit()
     except:
diff --git a/main.py b/main.py
index e8d199d..d4ae1c5 100755
--- a/main.py
+++ b/main.py
@@ -13,7 +13,6 @@ import sys
 import time
 from StringIO import StringIO
 
-
 def revertStandardError():
     """Move stderr to stdout, and return the contents of the old stderr."""
     errio = sys.stderr
@@ -641,7 +640,7 @@ if __name__ == '__main__':
     if not operation:
         operation = 'list'
 
-    #main(operation, u, fields)
-    import profile
-    profile.run('main(operation, u, fields)', 'log-'+operation)
+    main(operation, u, fields)
+    #import profile
+    #profile.run('main(operation, u, fields)', 'log-'+operation)
 
-- 
1.7.9.5