From 48e94bf75ce2be50d323e8b883cf3322c4d06c4e Mon Sep 17 00:00:00 2001 From: Sahid Orentino Ferdjaoui Date: Thu, 25 Sep 2014 17:15:10 +0200 Subject: [PATCH] cmd: update the default behavior of serial console When using serial console we are expecting using a plain websocket so we should to return the 'ws://' scheme as the default one, also it makes no sense to handle webserving content since currently nothing has been implemented in favor of this case. DocImpact: The 'base_url' option serial_console has been updated Closes-Bug: #1373950 Change-Id: I0d0e4f7060febec5e0a357cd3e8c05486f2afaa5 --- .../os-consoles/get-serial-console-post-resp.json | 2 +- .../os-consoles/get-serial-console-post-resp.xml | 2 +- nova/cmd/serialproxy.py | 7 ------- nova/console/serial.py | 2 +- nova/tests/integrated/test_api_samples.py | 2 +- 5 files changed, 4 insertions(+), 11 deletions(-) diff --git a/doc/api_samples/os-consoles/get-serial-console-post-resp.json b/doc/api_samples/os-consoles/get-serial-console-post-resp.json index 80df0e11dca8..990c9653cca0 100644 --- a/doc/api_samples/os-consoles/get-serial-console-post-resp.json +++ b/doc/api_samples/os-consoles/get-serial-console-post-resp.json @@ -1,6 +1,6 @@ { "console": { "type": "serial", - "url":"http://127.0.0.1:6083/?token=f9906a48-b71e-4f18-baca-c987da3ebdb3" + "url":"ws://127.0.0.1:6083/?token=f9906a48-b71e-4f18-baca-c987da3ebdb3" } } diff --git a/doc/api_samples/os-consoles/get-serial-console-post-resp.xml b/doc/api_samples/os-consoles/get-serial-console-post-resp.xml index 689a56d992f3..7216750b5fda 100644 --- a/doc/api_samples/os-consoles/get-serial-console-post-resp.xml +++ b/doc/api_samples/os-consoles/get-serial-console-post-resp.xml @@ -1,5 +1,5 @@ serial - http://127.0.0.1:6083/?token=f9906a48-b71e-4f18-baca-c987da3ebdb3 + ws://127.0.0.1:6083/?token=f9906a48-b71e-4f18-baca-c987da3ebdb3 diff --git a/nova/cmd/serialproxy.py b/nova/cmd/serialproxy.py index 6e28bc128583..031a94c1ea8f 100644 --- a/nova/cmd/serialproxy.py +++ b/nova/cmd/serialproxy.py @@ -48,7 +48,6 @@ CONF.import_opt('ssl_only', 'nova.cmd.novnc') CONF.import_opt('source_is_ipv6', 'nova.cmd.novnc') CONF.import_opt('cert', 'nova.cmd.novnc') CONF.import_opt('key', 'nova.cmd.novnc') -CONF.import_opt('web', 'nova.cmd.novnc') def exit_with_error(msg, errno=-1): @@ -62,11 +61,6 @@ def main(): if CONF.ssl_only and not os.path.exists(CONF.cert): exit_with_error("SSL only and %s not found" % CONF.cert) - # Check to see if tty html/js/css files are present - if not os.path.exists(CONF.web): - exit_with_error("Can not find serial terminal " - "html/js files at %s." % CONF.web) - logging.setup("nova") gmr.TextGuruMeditation.setup_autorun(version) @@ -82,7 +76,6 @@ def main(): daemon=CONF.daemon, record=CONF.record, traffic=CONF.verbose and not CONF.daemon, - web=CONF.web, file_only=True, RequestHandlerClass=websocketproxy.NovaProxyRequestHandler) server.start_server() diff --git a/nova/console/serial.py b/nova/console/serial.py index 3125fd782969..dca25d02c408 100644 --- a/nova/console/serial.py +++ b/nova/console/serial.py @@ -39,7 +39,7 @@ serial_opts = [ help='Range of TCP ports to use for serial ports ' 'on compute hosts'), cfg.StrOpt('base_url', - default='http://127.0.0.1:6083/', + default='ws://127.0.0.1:6083/', help='Location of serial console proxy.'), cfg.StrOpt('listen', default='127.0.0.1', diff --git a/nova/tests/integrated/test_api_samples.py b/nova/tests/integrated/test_api_samples.py index 217577586381..1625a01de23c 100644 --- a/nova/tests/integrated/test_api_samples.py +++ b/nova/tests/integrated/test_api_samples.py @@ -2127,7 +2127,7 @@ class ConsolesSampleJsonTests(ServersSampleBase): {'action': 'os-getSerialConsole'}) subs = self._get_regexes() subs["url"] = \ - "((https?):((//)|(\\\\))+([\w\d:#@%/;$()~_?\+-=\\\.&](#!)?)*)" + "((ws?):((//)|(\\\\))+([\w\d:#@%/;$()~_?\+-=\\\.&](#!)?)*)" self._verify_response('get-serial-console-post-resp', subs, response, 200)