Add port type on port option

According to [1] 
oslo.config can use portType to support the ability to set valid range 
on port option values. 
[1]: http://docs.openstack.org/developer/oslo.config/cfg.html

Change-Id: I71b6c7347f00e903321947074cdd55ee261bb505
This commit is contained in:
lei-zhang-99cloud 2015-08-26 10:05:34 +08:00 committed by lei zhang
parent 3e8b3bb3ad
commit 76e029c0aa

View File

@ -14,11 +14,14 @@
# 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'),
@ -27,8 +30,10 @@ paste_deploy_opts = [
bind_opts = [
cfg.StrOpt('bind-host', default='0.0.0.0',
help='Address to bind the Murano API server to.'),
cfg.IntOpt('bind-port', default=8082,
help='Port the bind the Murano API server to.'),
cfg.Opt('bind-port',
type=portType,
default=8082,
help='Port the bind the Murano API server to.'),
]
rabbit_opts = [
@ -36,8 +41,10 @@ rabbit_opts = [
help='The RabbitMQ broker address which used for communication '
'with Murano guest agents.'),
cfg.IntOpt('port', default=5672,
help='The RabbitMQ broker port.'),
cfg.Opt('port',
type=portType,
default=5672,
help='The RabbitMQ broker port.'),
cfg.StrOpt('login', default='guest',
help='The RabbitMQ login.'),