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
This commit is contained in:
Radoslav Gerganov 2016-03-18 12:56:04 +02:00 committed by Matt Riedemann
parent caa8305030
commit c5311439d6
3 changed files with 12 additions and 4 deletions

View File

@ -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)'),

View File

@ -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()

View File

@ -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.