diff options
| author | Julien Danjou <julien@danjou.info> | 2013-05-23 12:11:06 +0200 |
|---|---|---|
| committer | Julien Danjou <julien@danjou.info> | 2013-06-10 10:19:00 +0200 |
| commit | 7bf5c100775b4a859c3ef487cf6dfe1c460ede30 (patch) | |
| tree | 7e8478725ee0772ef5ed978f1855f6b1414c43f6 /nova/cmd | |
| parent | e0142d0f63bf64a07db3bd3b840fc2072d2e6ca3 (diff) | |
Enhance group handling in extract_opts
When there's 2 options with the same name, the script gets confused and
doesn't know in which group it goes. This fixes it, and fixes also the
template generation which is broken for various reasons:
- gettext.install was missing
- nova-rootwrap when imported calls exit() because it doesn't find a valid
configuration file, so let's exclude it entirely anyway
- eventlet/greendns needs to be ignored for this
Change-Id: Iaa4e9a806e79032ce1675b46a6b7a7628c3eff89
Signed-off-by: Julien Danjou <julien@danjou.info>
Diffstat (limited to 'nova/cmd')
| -rw-r--r-- | nova/cmd/novnc.py | 44 | ||||
| -rw-r--r-- | nova/cmd/novncproxy.py | 30 | ||||
| -rw-r--r-- | nova/cmd/spicehtml5proxy.py | 36 |
3 files changed, 62 insertions, 48 deletions
diff --git a/nova/cmd/novnc.py b/nova/cmd/novnc.py new file mode 100644 index 000000000..c381984da --- /dev/null +++ b/nova/cmd/novnc.py @@ -0,0 +1,44 @@ +# vim: tabstop=4 shiftwidth=4 softtabstop=4 + +# Copyright (c) 2012 OpenStack Foundation +# All Rights Reserved. +# +# Licensed under the Apache License, Version 2.0 (the "License"); you may +# not use this file except in compliance with the License. You may obtain +# a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT +# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the +# License for the specific language governing permissions and limitations +# under the License. + +from oslo.config import cfg + +opts = [ + cfg.BoolOpt('record', + default=False, + help='Record sessions to FILE.[session_number]'), + cfg.BoolOpt('daemon', + default=False, + help='Become a daemon (background process)'), + cfg.BoolOpt('ssl_only', + default=False, + help='Disallow non-encrypted connections'), + cfg.BoolOpt('source_is_ipv6', + default=False, + help='Source is ipv6'), + cfg.StrOpt('cert', + default='self.pem', + help='SSL certificate file'), + cfg.StrOpt('key', + default=None, + help='SSL key file (if separate from cert)'), + cfg.StrOpt('web', + default='/usr/share/spice-html5', + help='Run webserver on same port. Serve files from DIR.'), + ] + +cfg.CONF.register_cli_opts(opts) diff --git a/nova/cmd/novncproxy.py b/nova/cmd/novncproxy.py index 449aea76e..2abba7c90 100644 --- a/nova/cmd/novncproxy.py +++ b/nova/cmd/novncproxy.py @@ -30,27 +30,6 @@ from nova.console import websocketproxy opts = [ - cfg.BoolOpt('record', - default=False, - help='Record sessions to FILE.[session_number]'), - cfg.BoolOpt('daemon', - default=False, - help='Become a daemon (background process)'), - cfg.BoolOpt('ssl_only', - default=False, - help='Disallow non-encrypted connections'), - cfg.BoolOpt('source_is_ipv6', - default=False, - help='Source is ipv6'), - cfg.StrOpt('cert', - default='self.pem', - help='SSL certificate file'), - cfg.StrOpt('key', - default=None, - help='SSL key file (if separate from cert)'), - cfg.StrOpt('web', - default='/usr/share/novnc', - help='Run webserver on same port. Serve files from DIR.'), cfg.StrOpt('novncproxy_host', default='0.0.0.0', help='Host on which to listen for incoming requests'), @@ -61,11 +40,18 @@ opts = [ CONF = cfg.CONF CONF.register_cli_opts(opts) -CONF.import_opt('debug', 'nova.openstack.common.log') +CONF.import_opt('record', 'nova.cmd.novnc') +CONF.import_opt('daemon', 'nova.cmd.novnc') +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 main(): # Setup flags + CONF.set_defaults(CONF, web='/usr/share/novnc') config.parse_args(sys.argv) if CONF.ssl_only and not os.path.exists(CONF.cert): diff --git a/nova/cmd/spicehtml5proxy.py b/nova/cmd/spicehtml5proxy.py index c6f2be53d..561c6e7aa 100644 --- a/nova/cmd/spicehtml5proxy.py +++ b/nova/cmd/spicehtml5proxy.py @@ -28,29 +28,7 @@ from oslo.config import cfg from nova import config from nova.console import websocketproxy - opts = [ - cfg.BoolOpt('record', - default=False, - help='Record sessions to FILE.[session_number]'), - cfg.BoolOpt('daemon', - default=False, - help='Become a daemon (background process)'), - cfg.BoolOpt('ssl_only', - default=False, - help='Disallow non-encrypted connections'), - cfg.BoolOpt('source_is_ipv6', - default=False, - help='Source is ipv6'), - cfg.StrOpt('cert', - default='self.pem', - help='SSL certificate file'), - cfg.StrOpt('key', - default=None, - help='SSL key file (if separate from cert)'), - cfg.StrOpt('web', - default='/usr/share/spice-html5', - help='Run webserver on same port. Serve files from DIR.'), cfg.StrOpt('spicehtml5proxy_host', default='0.0.0.0', help='Host on which to listen for incoming requests'), @@ -59,13 +37,19 @@ opts = [ help='Port on which to listen for incoming requests'), ] +CONF = cfg.CONF +CONF.register_cli_opts(opts) +CONF.import_opt('record', 'nova.cmd.novnc') +CONF.import_opt('daemon', 'nova.cmd.novnc') +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 main(): # Setup flags - - CONF = cfg.CONF - CONF.register_cli_opts(opts) - CONF.import_opt('debug', 'nova.openstack.common.log') config.parse_args(sys.argv) if CONF.ssl_only and not os.path.exists(CONF.cert): |
