summaryrefslogtreecommitdiffstats
path: root/nova/cmd
diff options
context:
space:
mode:
authorJenkins <jenkins@review.openstack.org>2013-06-10 22:30:11 +0000
committerGerrit Code Review <review@openstack.org>2013-06-10 22:30:11 +0000
commit2d017a228812f6cbd1ae9bbbcc5d53f1f573ab94 (patch)
treee1d01f66dd99046c17557639591646a71e7b9e93 /nova/cmd
parentbfc1065fc19608a532eaba6e4f54409f9fedf5e7 (diff)
parent7bf5c100775b4a859c3ef487cf6dfe1c460ede30 (diff)
Merge "Enhance group handling in extract_opts"
Diffstat (limited to 'nova/cmd')
-rw-r--r--nova/cmd/novnc.py44
-rw-r--r--nova/cmd/novncproxy.py30
-rw-r--r--nova/cmd/spicehtml5proxy.py36
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):