From c4d07caf2fe50c170c2bc5d294120e7093da3a02 Mon Sep 17 00:00:00 2001 From: "zhu.rong" Date: Thu, 22 Oct 2015 14:15:48 +0800 Subject: [PATCH] Set the port to use oslo_config PortOpt Since oslo_config has already supported PortOpt, let's use the new type for port options. And add help for file_server. Change-Id: Id03c33e6200fe8bddce2e754df35e74e82e60b1e Depends-On: Ida294b05a85f5bef587b761fcd03c28c7a3474d8 Closes-Bug: #1508792 --- murano/common/config.py | 20 ++++++++------------ 1 file changed, 8 insertions(+), 12 deletions(-) diff --git a/murano/common/config.py b/murano/common/config.py index 2c21dc28..a78d0f96 100644 --- a/murano/common/config.py +++ b/murano/common/config.py @@ -14,14 +14,11 @@ # under the License. from oslo_config import cfg -from oslo_config import types from oslo_log import log as logging from murano.common.i18n import _ from murano import version -portType = types.Integer(1, 65535) - paste_deploy_opts = [ cfg.StrOpt('flavor', help='Paste flavor'), cfg.StrOpt('config_file', help='Path to Paste config file'), @@ -30,10 +27,9 @@ paste_deploy_opts = [ bind_opts = [ cfg.StrOpt('bind-host', default='0.0.0.0', help='Address to bind the Murano API server to.'), - cfg.Opt('bind-port', - type=portType, - default=8082, - help='Port the bind the Murano API server to.'), + cfg.PortOpt('bind-port', + default=8082, + help='Port the bind the Murano API server to.'), ] rabbit_opts = [ @@ -41,10 +37,9 @@ rabbit_opts = [ help='The RabbitMQ broker address which used for communication ' 'with Murano guest agents.'), - cfg.Opt('port', - type=portType, - default=5672, - help='The RabbitMQ broker port.'), + cfg.PortOpt('port', + default=5672, + help='The RabbitMQ broker port.'), cfg.StrOpt('login', default='guest', help='The RabbitMQ login.'), @@ -261,7 +256,8 @@ glance_opts = [ ] file_server = [ - cfg.StrOpt('file_server', default='') + cfg.StrOpt('file_server', default='', + help='Set a file server.') ] CONF = cfg.CONF