Update acls on creation and don't always through a spurious error
authorEric Price <ecprice@mit.edu>
Wed, 30 Jan 2008 04:47:34 +0000 (23:47 -0500)
committerEric Price <ecprice@mit.edu>
Wed, 30 Jan 2008 04:47:34 +0000 (23:47 -0500)
svn path=/trunk/web/; revision=265

controls.py

index b6f6dec..7134668 100644 (file)
@@ -10,6 +10,7 @@ import subprocess
 import sys
 import time
 import re
 import sys
 import time
 import re
+import cache_acls
 
 # ... and stolen from xend/uuid.py
 def randomUUID():
 
 # ... and stolen from xend/uuid.py
 def randomUUID():
@@ -85,9 +86,6 @@ def bootMachine(machine, cdtype):
     elif err:
         raise CodeError('"%s" on "control %s create %s' 
                         % (err, machine.name, cdtype))
     elif err:
         raise CodeError('"%s" on "control %s create %s' 
                         % (err, machine.name, cdtype))
-    else:
-        raise CodeError('"%s" on "control %s create %s' 
-                        % (err, machine.name, cdtype))
 
 def registerMachine(machine):
     """Register a machine to be controlled by the web interface"""
 
 def registerMachine(machine):
     """Register a machine to be controlled by the web interface"""
@@ -131,6 +129,7 @@ def createVm(owner, contact, name, memory, disk_size, is_hvm, cdrom):
         nic.hostname = name
         ctx.current.save(nic)    
         ctx.current.save(disk)
         nic.hostname = name
         ctx.current.save(nic)    
         ctx.current.save(disk)
+        cache_acls.refreshMachine(machine)
         transaction.commit()
     except:
         transaction.rollback()
         transaction.commit()
     except:
         transaction.rollback()