Use oslo_config new type PortOpt for port options
The oslo_config library provides new type PortOpt to validate the range of port now. Note, rpc_zmq_max_port is a socket port upper limit, so leave it untouched. Change-Id: Icac28141bcb09e2b894662de1a6497766351919d Closes-Bug: #1518256 ref: https://github.com/openstack/oslo.config/blob/2.6.0/oslo_config/cfg.py#L1114
This commit is contained in:
@@ -89,7 +89,7 @@ rabbit_opts = [
|
|||||||
deprecated_group='DEFAULT',
|
deprecated_group='DEFAULT',
|
||||||
help='The RabbitMQ broker address where a single node is '
|
help='The RabbitMQ broker address where a single node is '
|
||||||
'used.'),
|
'used.'),
|
||||||
cfg.IntOpt('rabbit_port',
|
cfg.PortOpt('rabbit_port',
|
||||||
default=5672,
|
default=5672,
|
||||||
deprecated_group='DEFAULT',
|
deprecated_group='DEFAULT',
|
||||||
help='The RabbitMQ broker port where a single node is used.'),
|
help='The RabbitMQ broker port where a single node is used.'),
|
||||||
|
|||||||
@@ -81,11 +81,13 @@ zmq_opts = [
|
|||||||
default=True,
|
default=True,
|
||||||
help='Shows whether zmq-messaging uses broker or not.'),
|
help='Shows whether zmq-messaging uses broker or not.'),
|
||||||
|
|
||||||
cfg.IntOpt('rpc_zmq_min_port',
|
cfg.PortOpt('rpc_zmq_min_port',
|
||||||
default=49152,
|
default=49152,
|
||||||
help='Minimal port number for random ports range.'),
|
help='Minimal port number for random ports range.'),
|
||||||
|
|
||||||
cfg.IntOpt('rpc_zmq_max_port',
|
cfg.IntOpt('rpc_zmq_max_port',
|
||||||
|
min=1,
|
||||||
|
max=65536,
|
||||||
default=65536,
|
default=65536,
|
||||||
help='Maximal port number for random ports range.'),
|
help='Maximal port number for random ports range.'),
|
||||||
|
|
||||||
|
|||||||
@@ -27,7 +27,7 @@ matchmaker_redis_opts = [
|
|||||||
cfg.StrOpt('host',
|
cfg.StrOpt('host',
|
||||||
default='127.0.0.1',
|
default='127.0.0.1',
|
||||||
help='Host to locate redis.'),
|
help='Host to locate redis.'),
|
||||||
cfg.IntOpt('port',
|
cfg.PortOpt('port',
|
||||||
default=6379,
|
default=6379,
|
||||||
help='Use this port to connect to redis host.'),
|
help='Use this port to connect to redis host.'),
|
||||||
cfg.StrOpt('password',
|
cfg.StrOpt('password',
|
||||||
|
|||||||
Reference in New Issue
Block a user