From 8d010cacb520786fa12794801bc31eddd23b2af7 Mon Sep 17 00:00:00 2001 From: Anthony Young Date: Thu, 22 Dec 2011 21:39:21 +0000 Subject: Implements blueprint vnc-console-cleanup * Creates a unified way to access vnc consoles for xenserver and libvirt * Now supports both java and websocket clients * Removes nova-vncproxy - a replacement version of this (nova-novncproxy) can be found as described in vncconsole.rst * Adds nova-xvpvncproxy, which supports a java vnc client * Adds api extension to access java and novnc access_urls * Fixes proxy server to close/shutdown sockets more cleanly * Address style feedback * Use new-style extension format * Fix setup.py * utils.gen_uuid must be wrapped like str(utils.gen_uuid()) or it can't be serialized Change-Id: I5e42e2f160e8e3476269bd64b0e8aa77e66c918c --- bin/nova-all | 8 +------- bin/nova-consoleauth | 48 ++++++++++++++++++++++++++++++++++++++++++++++++ bin/nova-vncproxy | 49 ------------------------------------------------- bin/nova-xvpvncproxy | 48 ++++++++++++++++++++++++++++++++++++++++++++++++ 4 files changed, 97 insertions(+), 56 deletions(-) create mode 100755 bin/nova-consoleauth delete mode 100755 bin/nova-vncproxy create mode 100755 bin/nova-xvpvncproxy (limited to 'bin') diff --git a/bin/nova-all b/bin/nova-all index 497195bda..9c9e2bbaa 100755 --- a/bin/nova-all +++ b/bin/nova-all @@ -44,7 +44,6 @@ from nova import flags from nova import log as logging from nova import service from nova import utils -from nova.vnc import server from nova.objectstore import s3server @@ -60,17 +59,12 @@ if __name__ == '__main__': servers.append(service.WSGIService(api)) except (Exception, SystemExit): logging.exception(_('Failed to load %s') % '%s-api' % api) - # nova-vncproxy - try: - servers.append(server.get_wsgi_server()) - except (Exception, SystemExit): - logging.exception(_('Failed to load %s') % 'vncproxy-wsgi') # nova-objectstore try: servers.append(s3server.get_wsgi_server()) except (Exception, SystemExit): logging.exception(_('Failed to load %s') % 'objectstore-wsgi') - for binary in ['nova-vncproxy', 'nova-compute', 'nova-volume', + for binary in ['nova-xvpvncproxy', 'nova-compute', 'nova-volume', 'nova-network', 'nova-scheduler', 'nova-vsa']: try: servers.append(service.Service.create(binary=binary)) diff --git a/bin/nova-consoleauth b/bin/nova-consoleauth new file mode 100755 index 000000000..325a399d7 --- /dev/null +++ b/bin/nova-consoleauth @@ -0,0 +1,48 @@ +#!/usr/bin/env python +# vim: tabstop=4 shiftwidth=4 softtabstop=4 + +# Copyright (c) 2012 Openstack, LLC. +# All Rights Reserved. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +"""VNC Console Proxy Server.""" + +import eventlet +eventlet.monkey_patch() + +import os +import sys + +possible_topdir = os.path.normpath(os.path.join(os.path.abspath(sys.argv[0]), + os.pardir, + os.pardir)) +if os.path.exists(os.path.join(possible_topdir, 'nova', '__init__.py')): + sys.path.insert(0, possible_topdir) + + +from nova import flags +from nova import log as logging +from nova import service +from nova import utils +from nova.consoleauth import manager + + +if __name__ == "__main__": + utils.default_flagfile() + flags.FLAGS(sys.argv) + logging.setup() + + server = service.Service.create(binary='nova-consoleauth') + service.serve(server) + service.wait() diff --git a/bin/nova-vncproxy b/bin/nova-vncproxy deleted file mode 100755 index 9b44a95ea..000000000 --- a/bin/nova-vncproxy +++ /dev/null @@ -1,49 +0,0 @@ -#!/usr/bin/env python -# vim: tabstop=4 shiftwidth=4 softtabstop=4 - -# Copyright (c) 2010 Openstack, LLC. -# All Rights Reserved. -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -"""VNC Console Proxy Server.""" - -import eventlet -eventlet.monkey_patch() - -import os -import sys - -possible_topdir = os.path.normpath(os.path.join(os.path.abspath(sys.argv[0]), - os.pardir, - os.pardir)) -if os.path.exists(os.path.join(possible_topdir, 'nova', '__init__.py')): - sys.path.insert(0, possible_topdir) - - -from nova import flags -from nova import log as logging -from nova import service -from nova import utils -from nova.vnc import server - - -if __name__ == "__main__": - utils.default_flagfile() - flags.FLAGS(sys.argv) - logging.setup() - - wsgi_server = server.get_wsgi_server() - server = service.Service.create(binary='nova-vncproxy') - service.serve(wsgi_server, server) - service.wait() diff --git a/bin/nova-xvpvncproxy b/bin/nova-xvpvncproxy new file mode 100755 index 000000000..a17d0cbb3 --- /dev/null +++ b/bin/nova-xvpvncproxy @@ -0,0 +1,48 @@ +#!/usr/bin/env python +# vim: tabstop=4 shiftwidth=4 softtabstop=4 + +# Copyright (c) 2010 Openstack, LLC. +# All Rights Reserved. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +"""XVP VNC Console Proxy Server.""" + +import eventlet +eventlet.monkey_patch() + +import os +import sys + +possible_topdir = os.path.normpath(os.path.join(os.path.abspath(sys.argv[0]), + os.pardir, + os.pardir)) +if os.path.exists(os.path.join(possible_topdir, 'nova', '__init__.py')): + sys.path.insert(0, possible_topdir) + + +from nova import flags +from nova import log as logging +from nova import service +from nova import utils +from nova.vnc import xvp_proxy + + +if __name__ == "__main__": + utils.default_flagfile() + flags.FLAGS(sys.argv) + logging.setup() + + wsgi_server = xvp_proxy.get_wsgi_server() + service.serve(wsgi_server) + service.wait() -- cgit