fix my spelling fix on shutdown button
[invirt/packages/invirt-web.git] / code / main.py
index 8204fb4..c0e9a98 100755 (executable)
@@ -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,
@@ -426,9 +429,10 @@ def helpHandler(user, fields):
     subjects = fields.getlist('subject')
     
     help_mapping = dict(paravm_console="""
-ParaVM machines do not support console access over VNC.  To access
-these machines, you either need to boot with a liveCD and ssh in or
-hope that the sipb-xen maintainers add support for serial consoles.""",
+ParaVM machines do not support local console access over VNC.  To
+access the serial console of these machines, you can SSH with Kerberos
+to sipb-xen-console.mit.edu, using the name of the machine as your
+username.""",
                         hvm_paravm="""
 HVM machines use the virtualization features of the processor, while
 ParaVM machines use Xen's emulation of virtualization features.  You
@@ -440,8 +444,8 @@ The owner field is used to determine <a
 href="help?subject=quotas">quotas</a>.  It must be the name of a
 locker that you are an AFS administrator of.  In particular, you or an
 AFS group you are a member of must have AFS rlidwka bits on the
-locker.  You can check see who administers the LOCKER locker using the
-command 'fs la /mit/LOCKER' on Athena.)  See also <a
+locker.  You can check who administers the LOCKER locker using the
+commands 'attach LOCKER; fs la /mit/LOCKER' on Athena.)  See also <a
 href="help?subject=administrator">administrator</a>.""",
                         administrator="""
 The administrator field determines who can access the console and
@@ -613,7 +617,7 @@ def main(operation, user, fields):
         output_string =  str(output)
         checkpoint.checkpoint('output as a string')
         print output_string
-        print '<pre>%s</pre>' % checkpoint
+        print '<!-- <pre>%s</pre> -->' % checkpoint
     except Exception, err:
         if not fields.has_key('js'):
             if isinstance(err, CodeError):