Use oslo_config new type PortOpt for port options

The oslo_config library provides new type PortOpt to validate the
range of port now.
ref: https://github.com/openstack/oslo.config/blob/2.6.0/oslo_config/cfg.py#L1114

DocImpact
Change-Id: I9a3e4d13feef67b4a43936c6099b822e4f1f6a57
Closes-Bug: #1514702
This commit is contained in:
chenying 2015-11-10 15:17:57 +08:00
parent 8e03c3b335
commit 7ef20e1b91
12 changed files with 38 additions and 50 deletions

View File

@ -62,9 +62,8 @@ service_opts = [
cfg.StrOpt('osapi_volume_listen',
default="0.0.0.0",
help='IP address on which OpenStack Volume API listens'),
cfg.IntOpt('osapi_volume_listen_port',
cfg.PortOpt('osapi_volume_listen_port',
default=8776,
min=1, max=65535,
help='Port on which OpenStack Volume API listens'),
cfg.IntOpt('osapi_volume_workers',
help='Number of workers for OpenStack Volume API service. '

View File

@ -93,7 +93,7 @@ class TestBrcdFCSanLookupService(brcd_lookup.BrcdFCSanLookupService,
fc_fabric_opts.append(cfg.StrOpt('fc_fabric_password',
default='password', help='',
secret=True))
fc_fabric_opts.append(cfg.IntOpt('fc_fabric_port',
fc_fabric_opts.append(cfg.PortOpt('fc_fabric_port',
default=22, help=''))
fc_fabric_opts.append(cfg.StrOpt('principal_switch_wwn',
default='100000051e55a100', help=''))

View File

@ -70,7 +70,7 @@ class TestCiscoFCSanLookupService(cisco_lookup.CiscoFCSanLookupService,
fc_fabric_opts.append(cfg.StrOpt('cisco_fc_fabric_password',
default='admin1234', help='',
secret=True))
fc_fabric_opts.append(cfg.IntOpt('cisco_fc_fabric_port',
fc_fabric_opts.append(cfg.PortOpt('cisco_fc_fabric_port',
default=22, help=''))
fc_fabric_opts.append(cfg.StrOpt('cisco_zoning_vsan',
default='304', help=''))

View File

@ -58,9 +58,8 @@ volume_opts = [
cfg.ListOpt('iscsi_secondary_ip_addresses',
default=[],
help='The list of secondary IP addresses of the iSCSI daemon'),
cfg.IntOpt('iscsi_port',
cfg.PortOpt('iscsi_port',
default=3260,
min=1, max=65535,
help='The port that the iSCSI daemon is listening on'),
cfg.IntOpt('num_volume_device_scan_tries',
default=3,
@ -258,9 +257,8 @@ iser_opts = [
cfg.StrOpt('iser_ip_address',
default='$my_ip',
help='The IP address that the iSER daemon is listening on'),
cfg.IntOpt('iser_port',
cfg.PortOpt('iser_port',
default=3260,
min=1, max=65535,
help='The port that the iSER daemon is listening on'),
cfg.StrOpt('iser_helper',
default='tgtadm',

View File

@ -29,9 +29,8 @@ common_opts = [
cfg.IntOpt('dell_sc_ssn',
default=64702,
help='Storage Center System Serial Number'),
cfg.IntOpt('dell_sc_api_port',
cfg.PortOpt('dell_sc_api_port',
default=3033,
min=1, max=65535,
help='Dell API port'),
cfg.StrOpt('dell_sc_server_folder',
default='openstack',

View File

@ -21,9 +21,8 @@ DPL_OPTS = [
cfg.StrOpt('dpl_pool',
default='',
help='DPL pool uuid in which DPL volumes are stored.'),
cfg.IntOpt('dpl_port',
cfg.PortOpt('dpl_port',
default=8357,
min=1, max=65535,
help='DPL port number.'),
]

View File

@ -49,9 +49,8 @@ nas_opts = [
default='',
help='Password to connect to NAS system.',
secret=True),
cfg.IntOpt('nas_ssh_port',
cfg.PortOpt('nas_ssh_port',
default=22,
min=1, max=65535,
help='SSH port to use to connect to NAS system.'),
cfg.StrOpt('nas_private_key',
default='',

View File

@ -55,9 +55,8 @@ san_opts = [
cfg.StrOpt('san_clustername',
default='',
help='Cluster name to use for creating volumes'),
cfg.IntOpt('san_ssh_port',
cfg.PortOpt('san_ssh_port',
default=22,
min=1, max=65535,
help='SSH port to use with SAN'),
cfg.BoolOpt('san_is_local',
default=False,

View File

@ -43,8 +43,7 @@ sheepdog_opts = [
cfg.StrOpt('sheepdog_store_address',
default='127.0.0.1',
help=('IP address of sheep daemon.')),
cfg.IntOpt('sheepdog_store_port',
min=1, max=65535,
cfg.PortOpt('sheepdog_store_port',
default=7000,
help=('Port of sheep daemon.'))
]

View File

@ -84,13 +84,11 @@ sf_opts = [
'memory, very large deployments may want to consider '
'setting to False.'),
cfg.IntOpt('sf_api_port',
cfg.PortOpt('sf_api_port',
default=443,
min=1, max=65535,
help='SolidFire API port. Useful if the device api is behind '
'a proxy on a different port.')]
CONF = cfg.CONF
CONF.register_opts(sf_opts)

View File

@ -31,9 +31,8 @@ brcd_zone_opts = [
default='',
help='Password for user',
secret=True),
cfg.IntOpt('fc_fabric_port',
cfg.PortOpt('fc_fabric_port',
default=22,
min=1, max=65535,
help='Connecting port'),
cfg.StrOpt('zoning_policy',
default='initiator-target',

View File

@ -28,9 +28,8 @@ cisco_zone_opts = [
default='',
help='Password for user',
secret=True),
cfg.IntOpt('cisco_fc_fabric_port',
cfg.PortOpt('cisco_fc_fabric_port',
default=22,
min=1, max=65535,
help='Connecting port'),
cfg.StrOpt('cisco_zoning_policy',
default='initiator-target',