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 patch makes use of that feature
for a number of options with well known minimum and maximum values.

Change-Id: I4f20adbd0140e312f9cde86f71000c3dbd6aaf19
This commit is contained in:
Eric Brown 2015-08-24 09:15:47 -07:00
parent 380ff5d666
commit 957ab703c0
3 changed files with 5 additions and 2 deletions

View File

@ -239,8 +239,9 @@ nsxv_opts = [
help=_('DVS ID for VLANs')), help=_('DVS ID for VLANs')),
cfg.IntOpt('maximum_tunnels_per_vnic', cfg.IntOpt('maximum_tunnels_per_vnic',
default=DEFAULT_MAXIMUM_TUNNELS_PER_VNIC, default=DEFAULT_MAXIMUM_TUNNELS_PER_VNIC,
min=1, max=110,
help=_('Maximum number of sub interfaces supported ' help=_('Maximum number of sub interfaces supported '
'per vnic in edge. The value should be in 1-110.')), 'per vnic in edge.')),
cfg.ListOpt('backup_edge_pool', cfg.ListOpt('backup_edge_pool',
default=['service:large:4:10', default=['service:large:4:10',
'service:compact:4:10', 'service:compact:4:10',
@ -266,6 +267,7 @@ nsxv_opts = [
help=_('IP addresses used by Nova metadata service')), help=_('IP addresses used by Nova metadata service')),
cfg.IntOpt('nova_metadata_port', cfg.IntOpt('nova_metadata_port',
default=8775, default=8775,
min=1, max=65535,
help=_("TCP Port used by Nova metadata server")), help=_("TCP Port used by Nova metadata server")),
cfg.StrOpt('metadata_shared_secret', cfg.StrOpt('metadata_shared_secret',
secret=True, secret=True,

View File

@ -57,6 +57,7 @@ metadata_opts = [
cfg.IntOpt('metadata_server_port', cfg.IntOpt('metadata_server_port',
deprecated_group='NVP_METADATA', deprecated_group='NVP_METADATA',
default=8775, default=8775,
min=1, max=65535,
help=_("TCP Port used by Metadata server.")), help=_("TCP Port used by Metadata server.")),
cfg.StrOpt('metadata_shared_secret', cfg.StrOpt('metadata_shared_secret',
deprecated_group='NVP_METADATA', deprecated_group='NVP_METADATA',

View File

@ -19,7 +19,7 @@ dvs_opts = [
cfg.StrOpt('host_ip', cfg.StrOpt('host_ip',
help='Hostname or IP address for connection to VMware vCenter ' help='Hostname or IP address for connection to VMware vCenter '
'host.'), 'host.'),
cfg.IntOpt('host_port', default=443, cfg.IntOpt('host_port', default=443, min=1, max=65535,
help='Port for connection to VMware vCenter host.'), help='Port for connection to VMware vCenter host.'),
cfg.StrOpt('host_username', cfg.StrOpt('host_username',
help='Username for connection to VMware vCenter host.'), help='Username for connection to VMware vCenter host.'),