diff options
author | Jenkins <jenkins@review.openstack.org> | 2014-10-08 16:14:35 +0000 |
---|---|---|
committer | Gerrit Code Review <review@openstack.org> | 2014-10-08 16:14:35 +0000 |
commit | e4fd16d4b27903aecd747e981ee743bdbae913ab (patch) | |
tree | eb831c112a16317b031e7edd513cd2180a4ec47b /nova/console | |
parent | 1510e264c073b4abca81b39ba98c1eeefd3161e2 (diff) | |
parent | 542d885874c063d6be0754393fcf70e00be7435a (diff) | |
download | nova-e4fd16d4b27903aecd747e981ee743bdbae913ab.tar.gz |
Merge "console: make unsupported ws scheme in python < 2.7.4"
Diffstat (limited to 'nova/console')
-rw-r--r-- | nova/console/websocketproxy.py | 12 |
1 files changed, 11 insertions, 1 deletions
diff --git a/nova/console/websocketproxy.py b/nova/console/websocketproxy.py index b2c3d0b59d..4d32ff4328 100644 --- a/nova/console/websocketproxy.py +++ b/nova/console/websocketproxy.py @@ -20,6 +20,7 @@ Leverages websockify.py by Joel Martin import Cookie import socket +import sys import urlparse import websockify @@ -43,7 +44,16 @@ class NovaProxyRequestHandlerBase(object): # The nova expected behavior is to have token # passed to the method GET of the request - query = urlparse.urlparse(self.path).query + parse = urlparse.urlparse(self.path) + if parse.scheme not in ('http', 'https'): + # From a bug in urlparse in Python < 2.7.4 we cannot support + # special schemes (cf: http://bugs.python.org/issue9374) + if sys.version_info < (2, 7, 4): + raise exception.NovaException( + _("We do not support scheme '%s' under Python < 2.7.4, " + "please use http or https") % parse.scheme) + + query = parse.query token = urlparse.parse_qs(query).get("token", [""]).pop() if not token: # NoVNC uses it's own convention that forward token |