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
This commit is contained in:
Sahid Orentino Ferdjaoui 2014-09-25 17:15:10 +02:00
parent 1dda5ef75a
commit 48e94bf75c
5 changed files with 4 additions and 11 deletions

View File

@ -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"
}
}

View File

@ -1,5 +1,5 @@
<?xml version='1.0' encoding='UTF-8'?>
<console>
<type>serial</type>
<url>http://127.0.0.1:6083/?token=f9906a48-b71e-4f18-baca-c987da3ebdb3</url>
<url>ws://127.0.0.1:6083/?token=f9906a48-b71e-4f18-baca-c987da3ebdb3</url>
</console>

View File

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

View File

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

View File

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