From c5311439d6526006dd1354e09f2bfb86505d550d Mon Sep 17 00:00:00 2001 From: Radoslav Gerganov Date: Fri, 18 Mar 2016 12:56:04 +0200 Subject: [PATCH] The 'record' option of the WebSocketProxy should be string If proxy service (VNC, spice, serial) is started with the 'record' option, an exception is thrown. This is because WebSocketProxy expects a file path for the record argument instead of boolean value. This patch fixes this by changing 'record' to be string option. An empty string means no recording. Closes-Bug: #1559026 Change-Id: Id6cf7c65191bdaa579f7cdadea43230897436de6 --- nova/cmd/novnc.py | 8 +++++--- nova/tests/unit/cmd/test_baseproxy.py | 2 +- releasenotes/notes/bug-1559026-47c3fa3468d66b07.yaml | 6 ++++++ 3 files changed, 12 insertions(+), 4 deletions(-) create mode 100644 releasenotes/notes/bug-1559026-47c3fa3468d66b07.yaml diff --git a/nova/cmd/novnc.py b/nova/cmd/novnc.py index dc96e2fac10d..0b69e5f3b676 100644 --- a/nova/cmd/novnc.py +++ b/nova/cmd/novnc.py @@ -16,9 +16,11 @@ from oslo_config import cfg opts = [ - cfg.BoolOpt('record', - default=False, - help='Record sessions to FILE.[session_number]'), + cfg.StrOpt('record', + help='This is the filename that will be used for storing ' + 'websocket frames received and sent by a proxy service ' + '(like VNC, spice, serial) running on this host. If this ' + 'is not set (default), no recording will be done.'), cfg.BoolOpt('daemon', default=False, help='Become a daemon (background process)'), diff --git a/nova/tests/unit/cmd/test_baseproxy.py b/nova/tests/unit/cmd/test_baseproxy.py index b8a16af3d075..8c89f8257ec0 100644 --- a/nova/tests/unit/cmd/test_baseproxy.py +++ b/nova/tests/unit/cmd/test_baseproxy.py @@ -61,7 +61,7 @@ class BaseProxyTestCase(test.NoDBTestCase): mock_init.assert_called_once_with( listen_host='0.0.0.0', listen_port='6080', source_is_ipv6=False, verbose=False, cert='self.pem', key=None, ssl_only=False, - daemon=False, record=False, traffic=False, + daemon=False, record=None, traffic=False, web='/usr/share/spice-html5', file_only=True, RequestHandlerClass=websocketproxy.NovaProxyRequestHandler) mock_start.assert_called_once_with() diff --git a/releasenotes/notes/bug-1559026-47c3fa3468d66b07.yaml b/releasenotes/notes/bug-1559026-47c3fa3468d66b07.yaml new file mode 100644 index 000000000000..62543bf94569 --- /dev/null +++ b/releasenotes/notes/bug-1559026-47c3fa3468d66b07.yaml @@ -0,0 +1,6 @@ +--- +upgrade: + - The ``record`` configuration option for the console proxy + services (like VNC, serial, spice) is changed from + boolean to string. It specifies the filename that will + be used for recording websocket frames.