give useful URIs after per-VM commands
[invirt/packages/invirt-web.git] / code / main.py
index a3c84ee..ebbd7dd 100755 (executable)
@@ -159,8 +159,13 @@ def parseCreate(user, fields):
     cdrom = fields.getfirst('cdrom')
     if cdrom is not None and not CDROM.get(cdrom):
         raise CodeError("Invalid cdrom type '%s'" % cdrom)
+
+    clone_from = fields.getfirst('clone_from')
+    if clone_from and clone_from != 'ice3':
+        raise CodeError("Invalid clone image '%s'" % clone_from)
+    
     return dict(contact=user, name=name, memory=memory, disk_size=disk_size,
-                owner=owner, is_hvm=is_hvm, cdrom=cdrom)
+                owner=owner, is_hvm=is_hvm, cdrom=cdrom, clone_from=clone_from)
 
 def create(user, fields):
     """Handler for create requests."""
@@ -339,9 +344,9 @@ def command(user, fields):
         return templates.list(searchList=[d])
     elif back == 'info':
         machine = validation.testMachineId(user, fields.getfirst('machine_id'))
-        d = infoDict(user, machine)
-        d['result'] = result
-        return templates.info(searchList=[d])
+        return ({'Status': '302',
+                 'Location': '/info?machine_id=%d' % machine.machine_id},
+                "You shouldn't see this message.")
     else:
         raise InvalidInput('back', back, 'Not a known back page.')
 
@@ -445,7 +450,13 @@ group.""",
                         quotas="""
 Quotas are determined on a per-locker basis.  Each quota may have a
 maximum of 512 megabytes of active ram, 50 gigabytes of disk, and 4
-active machines."""
+active machines.""",
+                        console="""
+<strong>Framebuffer:</strong> At a Linux boot prompt in your VM, try
+setting <tt>fb=false</tt> to disable the framebuffer.  If you don't,
+your machine will run just fine, but the applet's display of the
+console will suffer artifacts.
+"""
                    )
     
     if not subjects: