From 98cbbc2e6f630c9f5c4ab178457d5ffca74e2fad Mon Sep 17 00:00:00 2001 From: Eric Price Date: Tue, 3 Jun 2008 01:59:17 -0400 Subject: [PATCH] Avoid using os.environ in wsgi. svn path=/trunk/packages/sipb-xen-www/; revision=581 --- code/main.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/code/main.py b/code/main.py index ec14236..3d880c1 100755 --- a/code/main.py +++ b/code/main.py @@ -6,7 +6,6 @@ import cPickle import cgi import datetime import hmac -import os import sha import simplejson import sys @@ -262,7 +261,7 @@ def vnc(username, state, fields): on=status, has_vnc=has_vnc, machine=machine, - hostname=os.environ.get('SERVER_NAME', 'localhost'), + hostname=state.environ.get('SERVER_NAME', 'localhost'), authtoken=token) return templates.vnc(searchList=[d]) @@ -612,6 +611,7 @@ class App: self.username = getUser(environ) self.state = State(self.username) + self.state.environ = environ def __iter__(self): fields = cgi.FieldStorage(fp=self.environ['wsgi.input'], environ=self.environ) @@ -619,7 +619,7 @@ class App: operation = self.environ.get('PATH_INFO', '') if not operation: self.start("301 Moved Permanently", [('Location', - os.environ['SCRIPT_NAME']+'/')]) + self.environ['SCRIPT_NAME']+'/')]) return if self.username is None: operation = 'unauth' -- 1.7.9.5