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: Ifec4afcc5673563e1e63fe131b9df753818f0f98
This commit is contained in:
Eric Brown 2015-08-15 10:06:38 -07:00
parent 440da0c512
commit 52525071aa
3 changed files with 4 additions and 3 deletions

View File

@ -131,6 +131,7 @@ common_opts = [
'be a security risk, so use this setting with '
'caution! The overrides show_image_direct_url.')),
cfg.IntOpt('image_size_cap', default=1099511627776,
max=9223372036854775808,
help=_("Maximum size of image a user can upload in bytes. "
"Defaults to 1099511627776 bytes (1 TB)."
"WARNING: this value should only be increased after "
@ -159,7 +160,7 @@ common_opts = [
cfg.StrOpt('pydev_worker_debug_host',
help=_('The hostname/IP of the pydev process listening for '
'debug connections')),
cfg.IntOpt('pydev_worker_debug_port', default=5678,
cfg.IntOpt('pydev_worker_debug_port', default=5678, min=1, max=65535,
help=_('The port on which a pydev process is listening for '
'connections.')),
cfg.StrOpt('metadata_encryption_key', secret=True,

View File

@ -60,7 +60,7 @@ bind_opts = [
cfg.StrOpt('bind_host', default='0.0.0.0',
help=_('Address to bind the server. Useful when '
'selecting a particular network interface.')),
cfg.IntOpt('bind_port',
cfg.IntOpt('bind_port', min=1, max=65535,
help=_('The port on which the server will listen.')),
]

View File

@ -26,7 +26,7 @@ _ = i18n._
registry_addr_opts = [
cfg.StrOpt('registry_host', default='0.0.0.0',
help=_('Address to find the registry server.')),
cfg.IntOpt('registry_port', default=9191,
cfg.IntOpt('registry_port', default=9191, min=1, max=65535,
help=_('Port the registry server is listening on.')),
]