X-Git-Url: http://xvm.mit.edu/gitweb/invirt/packages/invirt-web.git/blobdiff_plain/7268d3236dc1ea69c8ff786e43ea77939c6d1a97..d678a204ee408e18f71061a6437ac88db561b5c6:/templates/main.py diff --git a/templates/main.py b/templates/main.py index 36ea239..bf40069 100755 --- a/templates/main.py +++ b/templates/main.py @@ -583,7 +583,10 @@ def testDisk(user, disksize, machine=None): return disksize def testName(user, name, machine=None): - return name + if Machine.select_by(name=name) == []: + return name + raise InvalidInput('name', name, + "Already taken") def testHostname(user, hostname, machine): for nic in machine.nics: @@ -640,6 +643,7 @@ def modify(user, fields): transaction.commit() except: transaction.rollback() + raise remctl("web", "moveregister", oldname, name) for disk in machine.disks: # XXX all disks get the same size on change? Interface doesn't support more.