Allow configuring proxy_host and proxy_port in nova.conf
Following patch I2d46b926f1c895aba412d84b4ee059fda3df9011, if proxy_host/proxy_port is configured in nova.conf or passed via command line, they are not taking effect for novncproxy, spice htmlproxy and serial proxy. This patch fixes the issue by parsing the arguments before calling baseproxy. Closes-Bug: #1424647 Change-Id: I183309d7f0a3b86881f05e7fe65d1399170b5a3d
This commit is contained in:
parent
7f7ecb2f63
commit
8f060f07c7
|
@ -23,7 +23,6 @@ import sys
|
|||
from oslo_config import cfg
|
||||
from oslo_log import log as logging
|
||||
|
||||
from nova import config
|
||||
from nova.console import websocketproxy
|
||||
from nova.openstack.common.report import guru_meditation_report as gmr
|
||||
from nova import version
|
||||
|
@ -44,8 +43,6 @@ def exit_with_error(msg, errno=-1):
|
|||
|
||||
|
||||
def proxy(host, port):
|
||||
# Setup flags
|
||||
config.parse_args(sys.argv)
|
||||
|
||||
if CONF.ssl_only and not os.path.exists(CONF.cert):
|
||||
exit_with_error("SSL only and %s not found" % CONF.cert)
|
||||
|
|
|
@ -18,9 +18,12 @@ Websocket proxy that is compatible with OpenStack Nova
|
|||
noVNC consoles. Leverages websockify.py by Joel Martin
|
||||
"""
|
||||
|
||||
import sys
|
||||
|
||||
from oslo_config import cfg
|
||||
|
||||
from nova.cmd import baseproxy
|
||||
from nova import config
|
||||
|
||||
|
||||
opts = [
|
||||
|
@ -39,6 +42,7 @@ CONF.register_cli_opts(opts)
|
|||
def main():
|
||||
# set default web flag option
|
||||
CONF.set_default('web', '/usr/share/novnc')
|
||||
config.parse_args(sys.argv)
|
||||
|
||||
baseproxy.proxy(
|
||||
host=CONF.novncproxy_host,
|
||||
|
|
|
@ -17,10 +17,12 @@ Websocket proxy that is compatible with OpenStack Nova
|
|||
Serial consoles. Leverages websockify.py by Joel Martin.
|
||||
Based on nova-novncproxy.
|
||||
"""
|
||||
import sys
|
||||
|
||||
from oslo_config import cfg
|
||||
|
||||
from nova.cmd import baseproxy
|
||||
from nova import config
|
||||
|
||||
|
||||
opts = [
|
||||
|
@ -39,6 +41,7 @@ CONF.register_cli_opts(opts, group="serial_console")
|
|||
def main():
|
||||
# set default web flag option
|
||||
CONF.set_default('web', None)
|
||||
config.parse_args(sys.argv)
|
||||
|
||||
baseproxy.proxy(
|
||||
host=CONF.serial_console.serialproxy_host,
|
||||
|
|
|
@ -18,9 +18,12 @@ Websocket proxy that is compatible with OpenStack Nova
|
|||
SPICE HTML5 consoles. Leverages websockify.py by Joel Martin
|
||||
"""
|
||||
|
||||
import sys
|
||||
|
||||
from oslo_config import cfg
|
||||
|
||||
from nova.cmd import baseproxy
|
||||
from nova import config
|
||||
|
||||
|
||||
opts = [
|
||||
|
@ -37,6 +40,7 @@ CONF.register_cli_opts(opts, group='spice')
|
|||
|
||||
|
||||
def main():
|
||||
config.parse_args(sys.argv)
|
||||
|
||||
baseproxy.proxy(
|
||||
host=CONF.spice.html5proxy_host,
|
||||
|
|
Loading…
Reference in New Issue