X-Git-Url: http://xvm.mit.edu/gitweb/invirt/packages/invirt-web.git/blobdiff_plain/c8c25d005cebfe1189f3ae69ab1440a236490eca..04544797be5fe1519f9218a3bb8f5b0d33b3e6c5:/code/main.py diff --git a/code/main.py b/code/main.py index d17ed97..98fe1a8 100755 --- a/code/main.py +++ b/code/main.py @@ -136,7 +136,7 @@ def hasVnc(status): def parseCreate(user, fields): name = fields.getfirst('name') if not validation.validMachineName(name): - raise InvalidInput('name', name, 'You must provide a machine name.') + raise InvalidInput('name', name, 'You must provide a machine name. Max 22 chars, alnum plus \'-\' and \'_\'.') name = name.lower() if Machine.get_by(name=name): @@ -210,6 +210,9 @@ def getListDict(user): owner=user, cdrom='gutsy-i386') checkpoint.checkpoint('Got defaults') + def sortkey(machine): + return (machine.owner != user, machine.owner, machine.name) + machines = sorted(machines, key=sortkey) d = dict(user=user, cant_add_vm=validation.cantAddVm(user), max_memory=max_memory,