From 2b4e872eda2ebc5724caba7a33d05c964ae2751e Mon Sep 17 00:00:00 2001 From: Greg Price Date: Mon, 7 Jul 2008 22:40:33 -0400 Subject: [PATCH] web: support sx-blade-2 for VNC applet Currently hardcodes host->port mapping. Put in database? svn path=/trunk/packages/sipb-xen-www/; revision=667 --- code/main.py | 5 +++++ code/templates/vnc.tmpl | 2 +- 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/code/main.py b/code/main.py index c8444e8..24254c7 100755 --- a/code/main.py +++ b/code/main.py @@ -255,6 +255,10 @@ def vnc(username, state, path, fields): token = {'data': pickled_data, 'digest': m.digest()} token = cPickle.dumps(token) token = base64.urlsafe_b64encode(token) + if controls.listHost(machine) == 'sx-blade-2.mit.edu': + port = 10004 + else: + port = 10003 status = controls.statusInfo(machine) has_vnc = hasVnc(status) @@ -264,6 +268,7 @@ def vnc(username, state, path, fields): has_vnc=has_vnc, machine=machine, hostname=state.environ.get('SERVER_NAME', 'localhost'), + port=port, authtoken=token) return templates.vnc(searchList=[d]) diff --git a/code/templates/vnc.tmpl b/code/templates/vnc.tmpl index e3fbcca..c61b4f6 100644 --- a/code/templates/vnc.tmpl +++ b/code/templates/vnc.tmpl @@ -16,7 +16,7 @@ Console to $machine.name - + -- 1.7.9.5