Use min and max on IntOpt option types
Latest version of oslo.config support the ability to set valid range on IntOpt option values. This path makes use of that feature for a number of options with well known minimum and maximum values. Change-Id: I26c920a2be68deeaa6ba534eb9d92b2960f78328
This commit is contained in:
parent
3c10d3876e
commit
0108a27f94
@ -19,6 +19,7 @@ from oslo_config import cfg
|
|||||||
OPTS = [
|
OPTS = [
|
||||||
cfg.IntOpt('port',
|
cfg.IntOpt('port',
|
||||||
default=8777,
|
default=8777,
|
||||||
|
min=1, max=65535,
|
||||||
deprecated_name='metering_api_port',
|
deprecated_name='metering_api_port',
|
||||||
deprecated_group='DEFAULT',
|
deprecated_group='DEFAULT',
|
||||||
help='The port for the ceilometer API server.',
|
help='The port for the ceilometer API server.',
|
||||||
|
@ -35,6 +35,7 @@ OPTS = [
|
|||||||
'an empty string to disable.'),
|
'an empty string to disable.'),
|
||||||
cfg.IntOpt('udp_port',
|
cfg.IntOpt('udp_port',
|
||||||
default=4952,
|
default=4952,
|
||||||
|
min=1, max=65535,
|
||||||
help='Port to which the UDP socket is bound.'),
|
help='Port to which the UDP socket is bound.'),
|
||||||
cfg.BoolOpt('requeue_sample_on_dispatcher_error',
|
cfg.BoolOpt('requeue_sample_on_dispatcher_error',
|
||||||
default=False,
|
default=False,
|
||||||
|
@ -34,6 +34,7 @@ OPTS = [
|
|||||||
help='IP address of the VMware vSphere host.'),
|
help='IP address of the VMware vSphere host.'),
|
||||||
cfg.IntOpt('host_port',
|
cfg.IntOpt('host_port',
|
||||||
default=443,
|
default=443,
|
||||||
|
min=1, max=65535,
|
||||||
help='Port of the VMware vSphere host.'),
|
help='Port of the VMware vSphere host.'),
|
||||||
cfg.StrOpt('host_username',
|
cfg.StrOpt('host_username',
|
||||||
default='',
|
default='',
|
||||||
|
Loading…
Reference in New Issue
Block a user