incorporate feedback from termie
This commit is contained in:
@@ -71,8 +71,6 @@ if __name__ == "__main__":
|
|||||||
LOG.audit(_("Starting nova-vnc-proxy node (version %s)"),
|
LOG.audit(_("Starting nova-vnc-proxy node (version %s)"),
|
||||||
version.version_string_with_vcs())
|
version.version_string_with_vcs())
|
||||||
|
|
||||||
service.serve()
|
|
||||||
|
|
||||||
if not (os.path.exists(FLAGS.vncproxy_wwwroot) and
|
if not (os.path.exists(FLAGS.vncproxy_wwwroot) and
|
||||||
os.path.exists(FLAGS.vncproxy_wwwroot + '/vnc_auto.html')):
|
os.path.exists(FLAGS.vncproxy_wwwroot + '/vnc_auto.html')):
|
||||||
LOG.info(_("Missing vncproxy_wwwroot (version %s)"),
|
LOG.info(_("Missing vncproxy_wwwroot (version %s)"),
|
||||||
@@ -96,6 +94,8 @@ if __name__ == "__main__":
|
|||||||
else:
|
else:
|
||||||
with_auth = auth.VNCNovaAuthMiddleware(with_logging)
|
with_auth = auth.VNCNovaAuthMiddleware(with_logging)
|
||||||
|
|
||||||
|
service.serve()
|
||||||
|
|
||||||
server = wsgi.Server()
|
server = wsgi.Server()
|
||||||
server.start(with_auth, FLAGS.vncproxy_port, host=FLAGS.vncproxy_host)
|
server.start(with_auth, FLAGS.vncproxy_port, host=FLAGS.vncproxy_host)
|
||||||
server.wait()
|
server.wait()
|
||||||
|
@@ -36,7 +36,7 @@ Configuring the VNC Proxy
|
|||||||
-------------------------
|
-------------------------
|
||||||
nova-vnc-proxy requires a websocket enabled html client to work properly. At
|
nova-vnc-proxy requires a websocket enabled html client to work properly. At
|
||||||
this time, the only tested client is a slightly modified fork of noVNC, which
|
this time, the only tested client is a slightly modified fork of noVNC, which
|
||||||
you can at find git://github.com/sleepsonthefloor/noVNC.git.
|
you can at find http://github.com/openstack/noVNC.git
|
||||||
|
|
||||||
.. todo:: add instruction for installing from package
|
.. todo:: add instruction for installing from package
|
||||||
|
|
||||||
|
@@ -486,7 +486,7 @@ class Controller(wsgi.Controller):
|
|||||||
"""Returns a url to an instance's ajaxterm console."""
|
"""Returns a url to an instance's ajaxterm console."""
|
||||||
try:
|
try:
|
||||||
self.compute_api.get_vnc_console(req.environ['nova.context'],
|
self.compute_api.get_vnc_console(req.environ['nova.context'],
|
||||||
int(id))
|
int(id))
|
||||||
except exception.NotFound:
|
except exception.NotFound:
|
||||||
return faults.Fault(exc.HTTPNotFound())
|
return faults.Fault(exc.HTTPNotFound())
|
||||||
return exc.HTTPAccepted()
|
return exc.HTTPAccepted()
|
||||||
|
@@ -627,8 +627,6 @@ class LibvirtConnection(driver.ComputeDriver):
|
|||||||
|
|
||||||
return {'token': token, 'host': host, 'port': port}
|
return {'token': token, 'host': host, 'port': port}
|
||||||
|
|
||||||
_image_sems = {} # FIXME: why is this here? (anthony)
|
|
||||||
|
|
||||||
@staticmethod
|
@staticmethod
|
||||||
def _cache_image(fn, target, fname, cow=False, *args, **kwargs):
|
def _cache_image(fn, target, fname, cow=False, *args, **kwargs):
|
||||||
"""Wrapper for a method that creates an image that caches the image.
|
"""Wrapper for a method that creates an image that caches the image.
|
||||||
|
@@ -20,9 +20,7 @@
|
|||||||
|
|
||||||
from nova import flags
|
from nova import flags
|
||||||
|
|
||||||
|
|
||||||
FLAGS = flags.FLAGS
|
FLAGS = flags.FLAGS
|
||||||
|
|
||||||
flags.DEFINE_string('vncproxy_topic', 'vncproxy',
|
flags.DEFINE_string('vncproxy_topic', 'vncproxy',
|
||||||
'the topic vnc proxy nodes listen on')
|
'the topic vnc proxy nodes listen on')
|
||||||
flags.DEFINE_string('vncproxy_url',
|
flags.DEFINE_string('vncproxy_url',
|
||||||
|
@@ -44,7 +44,7 @@ class VNCNovaAuthMiddleware(object):
|
|||||||
def __init__(self, app):
|
def __init__(self, app):
|
||||||
self.app = app
|
self.app = app
|
||||||
self.token_cache = {}
|
self.token_cache = {}
|
||||||
utils.LoopingCall(self.delete_expired_tokens).start(1)
|
utils.LoopingCall(self.delete_expired_cache_items).start(1)
|
||||||
|
|
||||||
@webob.dec.wsgify
|
@webob.dec.wsgify
|
||||||
def __call__(self, req):
|
def __call__(self, req):
|
||||||
@@ -78,7 +78,7 @@ class VNCNovaAuthMiddleware(object):
|
|||||||
self.token_cache[token] = rval
|
self.token_cache[token] = rval
|
||||||
return rval
|
return rval
|
||||||
|
|
||||||
def delete_expired_tokens(self):
|
def delete_expired_cache_items(self):
|
||||||
now = time.time()
|
now = time.time()
|
||||||
to_delete = []
|
to_delete = []
|
||||||
for k, v in self.token_cache.items():
|
for k, v in self.token_cache.items():
|
||||||
|
@@ -25,9 +25,9 @@ import eventlet
|
|||||||
from eventlet import wsgi
|
from eventlet import wsgi
|
||||||
from eventlet import websocket
|
from eventlet import websocket
|
||||||
|
|
||||||
from webob import Request
|
|
||||||
import webob
|
import webob
|
||||||
|
|
||||||
|
|
||||||
WS_ENDPOINT = '/data'
|
WS_ENDPOINT = '/data'
|
||||||
|
|
||||||
|
|
||||||
@@ -88,7 +88,7 @@ class WebsocketVNCProxy(object):
|
|||||||
_handle(environ, start_response)
|
_handle(environ, start_response)
|
||||||
|
|
||||||
def __call__(self, environ, start_response):
|
def __call__(self, environ, start_response):
|
||||||
req = Request(environ)
|
req = webob.Request(environ)
|
||||||
if req.path == WS_ENDPOINT:
|
if req.path == WS_ENDPOINT:
|
||||||
return self.proxy_connection(environ, start_response)
|
return self.proxy_connection(environ, start_response)
|
||||||
else:
|
else:
|
||||||
|
Reference in New Issue
Block a user