From 8247f350af7db639581c58e274e63463afe544c2 Mon Sep 17 00:00:00 2001 From: Shuquan Huang Date: Sun, 8 Nov 2015 20:12:25 +0800 Subject: [PATCH] remove default=None for config options In the cfg module default=None is set as the default value. Change-Id: I9303e2ae4b8f301757744efc09136868db29472a Closes-bug: #1323975 --- manila/common/config.py | 4 ---- manila/compute/nova.py | 2 -- manila/network/neutron/neutron_network_plugin.py | 6 ++---- manila/share/driver.py | 5 ----- manila/share/drivers/emc/driver.py | 7 +------ manila/share/drivers/generic.py | 1 - manila/share/drivers/glusterfs/__init__.py | 2 -- manila/share/drivers/glusterfs/common.py | 2 -- manila/share/drivers/glusterfs/layout_volume.py | 1 - manila/share/drivers/hdfs/hdfs_native.py | 4 ---- manila/share/drivers/hitachi/hds_hnas.py | 10 +--------- manila/share/drivers/ibm/gpfs.py | 5 ----- manila/share/drivers/netapp/options.py | 6 ------ manila/share/drivers/quobyte/quobyte.py | 1 - manila/share/drivers/service_instance.py | 1 - manila/tests/test_service.py | 1 - manila/wsgi.py | 3 --- manila_tempest_tests/config.py | 1 - 18 files changed, 4 insertions(+), 58 deletions(-) diff --git a/manila/common/config.py b/manila/common/config.py index f459951708..cfa86f9507 100644 --- a/manila/common/config.py +++ b/manila/common/config.py @@ -115,10 +115,8 @@ global_opts = [ default='nova', help='Availability zone of this node.'), cfg.StrOpt('default_share_type', - default=None, help='Default share type to use.'), cfg.ListOpt('memcached_servers', - default=None, help='Memcached servers or None for in process cache.'), cfg.StrOpt('share_usage_audit_period', default='month', @@ -129,7 +127,6 @@ global_opts = [ help='Deprecated: command to use for running commands as ' 'root.'), cfg.StrOpt('rootwrap_config', - default=None, help='Path to the rootwrap configuration file to use for ' 'running commands as root.'), cfg.BoolOpt('monkey_patch', @@ -149,7 +146,6 @@ global_opts = [ help='The strategy to use for auth. Supports noauth, keystone, ' 'and deprecated.'), cfg.ListOpt('enabled_share_backends', - default=None, help='A list of share backend names to use. These backend ' 'names should be backed by a unique [CONFIG] group ' 'with its options.'), diff --git a/manila/compute/nova.py b/manila/compute/nova.py index c9dfe32263..e79c0fabf6 100644 --- a/manila/compute/nova.py +++ b/manila/compute/nova.py @@ -38,10 +38,8 @@ nova_opts = [ default='compute:nova:adminURL', help='Same as nova_catalog_info, but for admin endpoint.'), cfg.StrOpt('os_region_name', - default=None, help='Region name of this node.'), cfg.StrOpt('nova_ca_certificates_file', - default=None, help='Location of CA certificates file to use for nova client ' 'requests.'), cfg.BoolOpt('nova_api_insecure', diff --git a/manila/network/neutron/neutron_network_plugin.py b/manila/network/neutron/neutron_network_plugin.py index 98db7bec8b..e360c3319a 100644 --- a/manila/network/neutron/neutron_network_plugin.py +++ b/manila/network/neutron/neutron_network_plugin.py @@ -30,16 +30,14 @@ neutron_single_network_plugin_opts = [ help="Default Neutron network that will be used for share server " "creation. This opt is used only with " "class 'NeutronSingleNetworkPlugin'.", - deprecated_group='DEFAULT', - default=None), + deprecated_group='DEFAULT'), cfg.StrOpt( 'neutron_subnet_id', help="Default Neutron subnet that will be used for share server " "creation. Should be assigned to network defined in opt " "'neutron_net_id'. This opt is used only with " "class 'NeutronSingleNetworkPlugin'.", - deprecated_group='DEFAULT', - default=None), + deprecated_group='DEFAULT'), ] CONF = cfg.CONF diff --git a/manila/share/driver.py b/manila/share/driver.py index cf585ee431..65ae886ccd 100644 --- a/manila/share/driver.py +++ b/manila/share/driver.py @@ -45,11 +45,9 @@ share_opts = [ help='The percentage of backend capacity reserved.'), cfg.StrOpt( 'share_backend_name', - default=None, help='The backend name for a given driver implementation.'), cfg.StrOpt( 'network_config_group', - default=None, help="Name of the configuration group in the Manila conf file " "to look for network config options." "If not set, the share backend's config group will be used." @@ -96,18 +94,15 @@ share_opts = [ 'when performing share migration (seconds).'), cfg.StrOpt( 'migration_mounting_backend_ip', - default=None, help="Backend IP in admin network to use for mounting " "shares during migration."), cfg.StrOpt( 'migration_data_copy_node_ip', - default=None, help="The IP of the node responsible for copying data during " "migration, such as the data copy service node, reachable by " "the backend."), cfg.StrOpt( 'migration_protocol_mount_command', - default=None, help="The command for mounting shares for this backend. Must specify" "the executable and all necessary parameters for the protocol " "supported. It is advisable to separate protocols per backend."), diff --git a/manila/share/drivers/emc/driver.py b/manila/share/drivers/emc/driver.py index 103f98b993..01597f9139 100644 --- a/manila/share/drivers/emc/driver.py +++ b/manila/share/drivers/emc/driver.py @@ -31,13 +31,10 @@ LOG = log.getLogger(__name__) EMC_NAS_OPTS = [ cfg.StrOpt('emc_nas_login', - default=None, help='User name for the EMC server.'), cfg.StrOpt('emc_nas_password', - default=None, help='Password for the EMC server.'), cfg.StrOpt('emc_nas_server', - default=None, help='EMC server hostname or IP address.'), cfg.IntOpt('emc_nas_server_port', default=8080, @@ -46,15 +43,13 @@ EMC_NAS_OPTS = [ default=True, help='Use secure connection to server.'), cfg.StrOpt('emc_share_backend', - default=None, help='Share backend.'), cfg.StrOpt('emc_nas_server_container', default='server_2', help='Container of share servers.'), cfg.StrOpt('emc_nas_pool_name', - default=None, help='EMC pool name.'), - cfg.StrOpt('emc_nas_root_dir', default=None, + cfg.StrOpt('emc_nas_root_dir', help='The root directory where shares will be located.'), ] diff --git a/manila/share/drivers/generic.py b/manila/share/drivers/generic.py index 94781f40c2..5c4381a02c 100644 --- a/manila/share/drivers/generic.py +++ b/manila/share/drivers/generic.py @@ -80,7 +80,6 @@ share_opts = [ choices=['ext4', 'ext3'], help='Filesystem type of the share volume.'), cfg.StrOpt('cinder_volume_type', - default=None, help='Name or id of cinder volume type which will be used ' 'for all volumes created by driver.'), ] diff --git a/manila/share/drivers/glusterfs/__init__.py b/manila/share/drivers/glusterfs/__init__.py index bb67ac8074..ecca496bde 100644 --- a/manila/share/drivers/glusterfs/__init__.py +++ b/manila/share/drivers/glusterfs/__init__.py @@ -47,13 +47,11 @@ GlusterfsManilaShare_opts = [ help='Type of NFS server that mediate access to the Gluster ' 'volumes (Gluster or Ganesha).'), cfg.StrOpt('glusterfs_ganesha_server_ip', - default=None, help="Remote Ganesha server node's IP address."), cfg.StrOpt('glusterfs_ganesha_server_username', default='root', help="Remote Ganesha server node's username."), cfg.StrOpt('glusterfs_ganesha_server_password', - default=None, secret=True, help="Remote Ganesha server node's login password. " "This is not required if 'glusterfs_path_to_private_key'" diff --git a/manila/share/drivers/glusterfs/common.py b/manila/share/drivers/glusterfs/common.py index 8882822e51..c93ac1f3b1 100644 --- a/manila/share/drivers/glusterfs/common.py +++ b/manila/share/drivers/glusterfs/common.py @@ -34,7 +34,6 @@ LOG = log.getLogger(__name__) glusterfs_common_opts = [ cfg.StrOpt('glusterfs_server_password', - default=None, secret=True, deprecated_name='glusterfs_native_server_password', help='Remote GlusterFS server node\'s login password. ' @@ -42,7 +41,6 @@ glusterfs_common_opts = [ '\'glusterfs_path_to_private_key\' is ' 'configured.'), cfg.StrOpt('glusterfs_path_to_private_key', - default=None, deprecated_name='glusterfs_native_path_to_private_key', help='Path of Manila host\'s private SSH key file.'), ] diff --git a/manila/share/drivers/glusterfs/layout_volume.py b/manila/share/drivers/glusterfs/layout_volume.py index 0f0e7f6f9a..efd4999d33 100644 --- a/manila/share/drivers/glusterfs/layout_volume.py +++ b/manila/share/drivers/glusterfs/layout_volume.py @@ -48,7 +48,6 @@ glusterfs_volume_mapped_opts = [ '[remoteuser@], and they are assumed to ' 'belong to distinct Gluster clusters.'), cfg.StrOpt('glusterfs_volume_pattern', - default=None, help='Regular expression template used to filter ' 'GlusterFS volumes for share creation. ' 'The regex template can optionally (ie. with support ' diff --git a/manila/share/drivers/hdfs/hdfs_native.py b/manila/share/drivers/hdfs/hdfs_native.py index 6bd8d26412..893de554ca 100644 --- a/manila/share/drivers/hdfs/hdfs_native.py +++ b/manila/share/drivers/hdfs/hdfs_native.py @@ -45,7 +45,6 @@ LOG = log.getLogger(__name__) hdfs_native_share_opts = [ cfg.StrOpt('hdfs_namenode_ip', - default=None, help='The IP of the HDFS namenode.'), cfg.IntOpt('hdfs_namenode_port', default=9000, @@ -54,15 +53,12 @@ hdfs_native_share_opts = [ default=22, help='HDFS namenode SSH port.'), cfg.StrOpt('hdfs_ssh_name', - default=None, help='HDFS namenode ssh login name.'), cfg.StrOpt('hdfs_ssh_pw', - default=None, help='HDFS namenode SSH login password, ' 'This parameter is not necessary, if ' '\'hdfs_ssh_private_key\' is configured.'), cfg.StrOpt('hdfs_ssh_private_key', - default=None, help='Path to HDFS namenode SSH private ' 'key for login.'), ] diff --git a/manila/share/drivers/hitachi/hds_hnas.py b/manila/share/drivers/hitachi/hds_hnas.py index c495b513c0..dbcb3cd4c6 100644 --- a/manila/share/drivers/hitachi/hds_hnas.py +++ b/manila/share/drivers/hitachi/hds_hnas.py @@ -27,34 +27,26 @@ LOG = log.getLogger(__name__) hds_hnas_opts = [ cfg.StrOpt('hds_hnas_ip', - default=None, help="HNAS management interface IP for communication " "between Manila controller and HNAS."), cfg.StrOpt('hds_hnas_user', - default=None, help="HNAS username Base64 String in order to perform tasks " "such as create file-systems and network interfaces."), cfg.StrOpt('hds_hnas_password', - default=None, secret=True, help="HNAS user password. Required only if private key is not " "provided."), cfg.StrOpt('hds_hnas_evs_id', - default=None, help="Specify which EVS this backend is assigned to."), cfg.StrOpt('hds_hnas_evs_ip', - default=None, help="Specify IP for mounting shares."), cfg.StrOpt('hds_hnas_file_system_name', - default=None, help="Specify file-system name for creating shares."), cfg.StrOpt('hds_hnas_ssh_private_key', - default=None, secret=True, help="RSA/DSA private key value used to connect into HNAS. " "Required only if password is not provided."), cfg.StrOpt('hds_hnas_cluster_admin_ip0', - default=None, help="The IP of the clusters admin node. Only set in HNAS " "multinode clusters."), cfg.IntOpt('hds_hnas_stalled_job_timeout', @@ -427,4 +419,4 @@ class HDSHNASDriver(driver.ShareDriver): if hnas_id is None: hnas_id = share_id - return hnas_id \ No newline at end of file + return hnas_id diff --git a/manila/share/drivers/ibm/gpfs.py b/manila/share/drivers/ibm/gpfs.py index 7bb7d39932..ec1e848fe9 100644 --- a/manila/share/drivers/ibm/gpfs.py +++ b/manila/share/drivers/ibm/gpfs.py @@ -60,7 +60,6 @@ ERR_FILE_NOT_FOUND = 2 gpfs_share_opts = [ cfg.StrOpt('gpfs_share_export_ip', - default=None, help='IP to be added to GPFS export string.'), cfg.StrOpt('gpfs_mount_point_base', default='$state_path/mnt', @@ -70,23 +69,19 @@ gpfs_share_opts = [ help=('NFS Server type. Valid choices are "KNFS" (kernel NFS) ' 'or "GNFS" (Ganesha NFS).')), cfg.ListOpt('gpfs_nfs_server_list', - default=None, 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.StrOpt('gpfs_ssh_login', - default=None, help='GPFS server SSH login name.'), cfg.StrOpt('gpfs_ssh_password', - default=None, secret=True, help='GPFS server SSH login password. ' 'The password is not needed, if \'gpfs_ssh_private_key\' ' 'is configured.'), cfg.StrOpt('gpfs_ssh_private_key', - default=None, help='Path to GPFS server SSH private key for login.'), cfg.ListOpt('gpfs_share_helpers', default=[ diff --git a/manila/share/drivers/netapp/options.py b/manila/share/drivers/netapp/options.py index d857658b04..49ef8def81 100644 --- a/manila/share/drivers/netapp/options.py +++ b/manila/share/drivers/netapp/options.py @@ -32,10 +32,8 @@ netapp_proxy_opts = [ netapp_connection_opts = [ cfg.StrOpt('netapp_server_hostname', deprecated_name='netapp_nas_server_hostname', - default=None, help='The hostname (or IP address) for the storage system.'), cfg.IntOpt('netapp_server_port', - default=None, 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.')), ] @@ -51,12 +49,10 @@ netapp_transport_opts = [ netapp_basicauth_opts = [ cfg.StrOpt('netapp_login', deprecated_name='netapp_nas_login', - default=None, help=('Administrative user account name used to access the ' 'storage system.')), cfg.StrOpt('netapp_password', deprecated_name='netapp_nas_password', - default=None, help=('Password for the administrative user account ' 'specified in the netapp_login option.'), secret=True), ] @@ -91,7 +87,6 @@ netapp_provisioning_opts = [ netapp_cluster_opts = [ cfg.StrOpt('netapp_vserver', - default=None, help=('This option specifies the Storage Virtual Machine ' '(i.e. Vserver) name on the storage cluster on which ' 'provisioning of file storage shares should occur. This ' @@ -102,7 +97,6 @@ netapp_cluster_opts = [ netapp_support_opts = [ cfg.StrOpt('netapp_trace_flags', - default=None, help=('Comma-separated list of options that control which ' 'trace info is written to the debug logs. Values ' 'include method and api.')), ] diff --git a/manila/share/drivers/quobyte/quobyte.py b/manila/share/drivers/quobyte/quobyte.py index 33cff4d541..09aaf4b650 100644 --- a/manila/share/drivers/quobyte/quobyte.py +++ b/manila/share/drivers/quobyte/quobyte.py @@ -41,7 +41,6 @@ quobyte_manila_share_opts = [ cfg.StrOpt('quobyte_api_url', help='URL of the Quobyte API server (http or https)'), cfg.StrOpt('quobyte_api_ca', - default=None, help='The X.509 CA file to verify the server cert.'), cfg.BoolOpt('quobyte_delete_shares', default=False, diff --git a/manila/share/drivers/service_instance.py b/manila/share/drivers/service_instance.py index a39c8a5f27..39d056aef9 100644 --- a/manila/share/drivers/service_instance.py +++ b/manila/share/drivers/service_instance.py @@ -125,7 +125,6 @@ common_opts = [ help="User in service instance that will be used for authentication."), cfg.StrOpt( "service_instance_password", - default=None, secret=True, help="Password for service instance user."), cfg.StrOpt( diff --git a/manila/tests/test_service.py b/manila/tests/test_service.py index ff64b8d958..22874a4dbd 100644 --- a/manila/tests/test_service.py +++ b/manila/tests/test_service.py @@ -39,7 +39,6 @@ test_service_opts = [ default="manila.tests.test_service.FakeManager", help="Manager for testing"), cfg.StrOpt("test_service_listen", - default=None, help="Host to bind test service to"), cfg.IntOpt("test_service_listen_port", default=0, diff --git a/manila/wsgi.py b/manila/wsgi.py index 6c24b6418b..f322463f43 100644 --- a/manila/wsgi.py +++ b/manila/wsgi.py @@ -64,15 +64,12 @@ socket_opts = [ help="Sets the value of TCP_KEEPCNT for each " "server socket. Not supported on OS X."), cfg.StrOpt('ssl_ca_file', - default=None, help="CA certificate file to use to verify " "connecting clients."), cfg.StrOpt('ssl_cert_file', - default=None, help="Certificate file to use when starting " "the server securely."), cfg.StrOpt('ssl_key_file', - default=None, help="Private key file to use when starting " "the server securely."), ] diff --git a/manila_tempest_tests/config.py b/manila_tempest_tests/config.py index 8873ef6add..22a2e3c8b9 100644 --- a/manila_tempest_tests/config.py +++ b/manila_tempest_tests/config.py @@ -176,6 +176,5 @@ ShareGroup = [ help="Time to wait for share migration before " "timing out (seconds)."), cfg.StrOpt("default_share_type_name", - default=None, help="Default share type name to use in tempest tests."), ]