Use PortOpt instead of min/max on IntOpt

Newly introduced in oslo.config is the PortOpt which is a subclass
of IntOpt with the min=1 and max=65535.

Change-Id: Ib6a95d738f8604497752daf1f646201ce7d99c30
This commit is contained in:
Eric Brown 2015-11-02 15:16:04 -08:00
parent 98e7aff7cb
commit d47ea9da12
3 changed files with 9 additions and 11 deletions

View File

@ -295,9 +295,8 @@ nsxv_opts = [
'metadata proxy')),
cfg.ListOpt('nova_metadata_ips',
help=_('IP addresses used by Nova metadata service')),
cfg.IntOpt('nova_metadata_port',
cfg.PortOpt('nova_metadata_port',
default=8775,
min=1, max=65535,
help=_("TCP Port used by Nova metadata server")),
cfg.StrOpt('metadata_shared_secret',
secret=True,

View File

@ -54,10 +54,9 @@ metadata_opts = [
deprecated_group='NVP_METADATA',
default='127.0.0.1',
help=_("IP address used by Metadata server.")),
cfg.IntOpt('metadata_server_port',
cfg.PortOpt('metadata_server_port',
deprecated_group='NVP_METADATA',
default=8775,
min=1, max=65535,
help=_("TCP Port used by Metadata server.")),
cfg.StrOpt('metadata_shared_secret',
deprecated_group='NVP_METADATA',

View File

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