In websockify v0.9.0, the 'socket' staticmethod moved from the
websockfiy.websocket.WebSocketServer class to the
websockify.websockifyserver.WebSockifyServer class [1][2], so our
import of the top-level module is no longer sufficient for accessing
the 'socket' method [3] when using v0.9.0:
AttributeError: module 'websockify' has no attribute 'WebSocketServer'
This adds a try_import from the v0.9.0 location and uses
WebSockifyServer.socket if the module is present. Otherwise, it
will fall back on the old location. This way, we are able to run with
websockify v0.9.0 and earlier versions with the same code.
Reviewed: https:/ /review. opendev. org/677856 /git.openstack. org/cgit/ openstack/ nova/commit/ ?id=791fa595e6f 1eb2447a4bebf4e cb390c85de0b44
Committed: https:/
Submitter: Zuul
Branch: master
commit 791fa595e6f1eb2 447a4bebf4ecb39 0c85de0b44
Author: melanie witt <email address hidden>
Date: Wed Aug 21 23:52:52 2019 +0000
Handle websockify v0.9.0 in console proxy
In websockify v0.9.0, the 'socket' staticmethod moved from the websocket. WebSocketServer class to the websockifyserve r.WebSockifySer ver class [1][2], so our
websockfiy.
websockify.
import of the top-level module is no longer sufficient for accessing
the 'socket' method [3] when using v0.9.0:
AttributeE rror: module 'websockify' has no attribute 'WebSocketServer'
This adds a try_import from the v0.9.0 location and uses erver.socket if the module is present. Otherwise, it
WebSockifyS
will fall back on the old location. This way, we are able to run with
websockify v0.9.0 and earlier versions with the same code.
Partial-Bug: #1840788
[1] https:/ /github. com/novnc/ websockify/ commit/ 8a697622495fd31 9582cd1c604e7eb 2cc0ac0ef6 /github. com/novnc/ websockify/ commit/ e47591f4aaa0221 a187d3ea2f61c7a b5bb93ed54 /github. com/novnc/ websockify/ blob/v0. 9.0/websockify/ __init_ _.py
[2] https:/
[3] https:/
Change-Id: I4a50e2f7721013 15140df43910be2 e3f69a63b73