From 2a148d3d3151a388cdfb1c5961f423e6e1d4fc6a Mon Sep 17 00:00:00 2001 From: ZhiQiang Fan Date: Thu, 22 Oct 2015 00:49:11 -0600 Subject: [PATCH] Use oslo_config new type PortOpt for port options The oslo_config library provides new type PortOpt to validate the range of port now. Change-Id: I8d1746c399268d7b3388db82de77c5e6c06844a3 ref: https://github.com/openstack/oslo.config/blob/2.6.0/oslo_config/cfg.py#L1114 --- manila/service.py | 6 +++--- manila/share/drivers/emc/driver.py | 6 +++--- manila/share/drivers/hdfs/hdfs_native.py | 12 ++++++------ manila/share/drivers/hp/hp_3par_driver.py | 6 +++--- manila/share/drivers/ibm/gpfs.py | 6 +++--- manila/share/drivers/netapp/options.py | 8 ++++---- 6 files changed, 22 insertions(+), 22 deletions(-) diff --git a/manila/service.py b/manila/service.py index 5e7ed528..fcac4e61 100644 --- a/manila/service.py +++ b/manila/service.py @@ -55,9 +55,9 @@ service_opts = [ cfg.StrOpt('osapi_share_listen', default="::", help='IP address for OpenStack Share API to listen on.'), - cfg.IntOpt('osapi_share_listen_port', - default=8786, - help='Port for OpenStack Share API to listen on.'), + cfg.PortOpt('osapi_share_listen_port', + default=8786, + help='Port for OpenStack Share API to listen on.'), cfg.IntOpt('osapi_share_workers', default=1, help='Number of workers for OpenStack Share API service.'), diff --git a/manila/share/drivers/emc/driver.py b/manila/share/drivers/emc/driver.py index 01597f91..5b49e7a5 100644 --- a/manila/share/drivers/emc/driver.py +++ b/manila/share/drivers/emc/driver.py @@ -36,9 +36,9 @@ EMC_NAS_OPTS = [ help='Password for the EMC server.'), cfg.StrOpt('emc_nas_server', help='EMC server hostname or IP address.'), - cfg.IntOpt('emc_nas_server_port', - default=8080, - help='Port number for the EMC server.'), + cfg.PortOpt('emc_nas_server_port', + default=8080, + help='Port number for the EMC server.'), cfg.BoolOpt('emc_nas_server_secure', default=True, help='Use secure connection to server.'), diff --git a/manila/share/drivers/hdfs/hdfs_native.py b/manila/share/drivers/hdfs/hdfs_native.py index 893de554..79b1aa51 100644 --- a/manila/share/drivers/hdfs/hdfs_native.py +++ b/manila/share/drivers/hdfs/hdfs_native.py @@ -46,12 +46,12 @@ LOG = log.getLogger(__name__) hdfs_native_share_opts = [ cfg.StrOpt('hdfs_namenode_ip', help='The IP of the HDFS namenode.'), - cfg.IntOpt('hdfs_namenode_port', - default=9000, - help='The port of HDFS namenode service.'), - cfg.IntOpt('hdfs_ssh_port', - default=22, - help='HDFS namenode SSH port.'), + cfg.PortOpt('hdfs_namenode_port', + default=9000, + help='The port of HDFS namenode service.'), + cfg.PortOpt('hdfs_ssh_port', + default=22, + help='HDFS namenode SSH port.'), cfg.StrOpt('hdfs_ssh_name', help='HDFS namenode ssh login name.'), cfg.StrOpt('hdfs_ssh_pw', diff --git a/manila/share/drivers/hp/hp_3par_driver.py b/manila/share/drivers/hp/hp_3par_driver.py index fc07eac8..5f7c1621 100644 --- a/manila/share/drivers/hp/hp_3par_driver.py +++ b/manila/share/drivers/hp/hp_3par_driver.py @@ -55,9 +55,9 @@ HP3PAR_OPTS = [ default='', help="Password for SAN controller", secret=True), - cfg.IntOpt('hp3par_san_ssh_port', - default=22, - help='SSH port to use with SAN'), + cfg.PortOpt('hp3par_san_ssh_port', + default=22, + help='SSH port to use with SAN'), cfg.StrOpt('hp3par_fpg', default="OpenStack", help="The File Provisioning Group (FPG) to use"), diff --git a/manila/share/drivers/ibm/gpfs.py b/manila/share/drivers/ibm/gpfs.py index ec1e848f..ff438118 100644 --- a/manila/share/drivers/ibm/gpfs.py +++ b/manila/share/drivers/ibm/gpfs.py @@ -71,9 +71,9 @@ gpfs_share_opts = [ cfg.ListOpt('gpfs_nfs_server_list', help=('A list of the fully qualified NFS server names that ' 'make up the OpenStack Manila configuration.')), - cfg.IntOpt('gpfs_ssh_port', - default=22, - help='GPFS server SSH port.'), + cfg.PortOpt('gpfs_ssh_port', + default=22, + help='GPFS server SSH port.'), cfg.StrOpt('gpfs_ssh_login', help='GPFS server SSH login name.'), cfg.StrOpt('gpfs_ssh_password', diff --git a/manila/share/drivers/netapp/options.py b/manila/share/drivers/netapp/options.py index 49ef8def..8dd78684 100644 --- a/manila/share/drivers/netapp/options.py +++ b/manila/share/drivers/netapp/options.py @@ -33,10 +33,10 @@ netapp_connection_opts = [ cfg.StrOpt('netapp_server_hostname', deprecated_name='netapp_nas_server_hostname', help='The hostname (or IP address) for the storage system.'), - cfg.IntOpt('netapp_server_port', - help=('The TCP port to use for communication with the storage ' - 'system or proxy server. If not specified, Data ONTAP ' - 'drivers will use 80 for HTTP and 443 for HTTPS.')), ] + cfg.PortOpt('netapp_server_port', + help=('The TCP port to use for communication with the storage ' + 'system or proxy server. If not specified, Data ONTAP ' + 'drivers will use 80 for HTTP and 443 for HTTPS.')), ] netapp_transport_opts = [ cfg.StrOpt('netapp_transport_type',