Makes deleting VMs work with the access controls.
authorEric Price <ecprice@mit.edu>
Tue, 27 Nov 2007 07:06:29 +0000 (02:06 -0500)
committerEric Price <ecprice@mit.edu>
Tue, 27 Nov 2007 07:06:29 +0000 (02:06 -0500)
svn path=/trunk/web/; revision=247

controls.py
main.py

index 4099d3b..620402b 100644 (file)
@@ -201,6 +201,8 @@ def deleteVM(machine):
             ctx.current.save(nic)
         for disk in machine.disks:
             ctx.current.delete(disk)
             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:
         ctx.current.delete(machine)
         transaction.commit()
     except:
diff --git a/main.py b/main.py
index e8d199d..d4ae1c5 100755 (executable)
--- a/main.py
+++ b/main.py
@@ -13,7 +13,6 @@ import sys
 import time
 from StringIO import StringIO
 
 import time
 from StringIO import StringIO
 
-
 def revertStandardError():
     """Move stderr to stdout, and return the contents of the old stderr."""
     errio = sys.stderr
 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'
 
     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)