From: Paul Weaver <pweaver@mit.edu>
Date: Wed, 30 Dec 2009 20:42:23 +0000 (-0500)
Subject: Moved all code for service messages to unauth.make
X-Git-Tag: 0.1.5~7
X-Git-Url: http://xvm.mit.edu/gitweb/invirt/packages/invirt-web.git/commitdiff_plain/d8276b5c303ed6bb8e0596e6332bad50f1b7fb71

Moved all code for service messages to unauth.make

svn path=/trunk/packages/invirt-web/; revision=2814
---

diff --git a/code/main.py b/code/main.py
index 9f57f84..ecf0305 100755
--- a/code/main.py
+++ b/code/main.py
@@ -51,11 +51,7 @@ class InvirtUnauthWeb(View):
     @cherrypy.expose
     @cherrypy.tools.mako(filename="/unauth.mako")
     def index(self):
-        d = dict(simple=True)
-        if os.path.exists("/etc/invirt/message"):
-            f = open('/etc/invirt/message')
-            d['serviceMessage']= f.read()
-        return d
+        return dict(simple=True)
 
 class InvirtWeb(View):
     def __init__(self):
diff --git a/code/templates/unauth.mako b/code/templates/unauth.mako
index 08dd617..ec67c80 100644
--- a/code/templates/unauth.mako
+++ b/code/templates/unauth.mako
@@ -13,9 +13,10 @@ own complete system on which you can start from our <strong>three-minute
 Debian or Ubuntu install</strong> or install the <strong>operating
 system of your choice</strong>.  The service is <strong>free</strong>
 to any Athena account holder.</p>
-%if serviceMessage:
+
+%if os.path.exists("/etc/invirt/message"):
 <div class="result">
-<p class="error">${serviceMessage}</p>
+<p class="error">${open('/etc/invirt/message').read()}</p>
 </div>
 %endif