From 8f060f07c7eeb1d1356f0ce6c0e1ca6ec4ec0b96 Mon Sep 17 00:00:00 2001 From: sridhargaddam Date: Mon, 23 Feb 2015 14:59:52 +0000 Subject: [PATCH] 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 --- nova/cmd/baseproxy.py | 3 --- nova/cmd/novncproxy.py | 4 ++++ nova/cmd/serialproxy.py | 3 +++ nova/cmd/spicehtml5proxy.py | 4 ++++ 4 files changed, 11 insertions(+), 3 deletions(-) diff --git a/nova/cmd/baseproxy.py b/nova/cmd/baseproxy.py index aa398579fb28..999b8c102d0a 100644 --- a/nova/cmd/baseproxy.py +++ b/nova/cmd/baseproxy.py @@ -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) diff --git a/nova/cmd/novncproxy.py b/nova/cmd/novncproxy.py index e7dc1fa01057..c34479cb7222 100644 --- a/nova/cmd/novncproxy.py +++ b/nova/cmd/novncproxy.py @@ -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, diff --git a/nova/cmd/serialproxy.py b/nova/cmd/serialproxy.py index e12361f42a53..cc92915a66a9 100644 --- a/nova/cmd/serialproxy.py +++ b/nova/cmd/serialproxy.py @@ -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, diff --git a/nova/cmd/spicehtml5proxy.py b/nova/cmd/spicehtml5proxy.py index efb7a5a13987..b0bd3971d70a 100644 --- a/nova/cmd/spicehtml5proxy.py +++ b/nova/cmd/spicehtml5proxy.py @@ -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,