From dc9c3cb3e376e6af263e4ffae88471317f830e0a Mon Sep 17 00:00:00 2001 From: Zhongyue Luo Date: Wed, 16 May 2012 06:01:43 +0000 Subject: Misused and not used config options Fixes bug #1000071 [nova.flag.py] stub_network: StrOpt -> BoolOpt [nova.api.sizelimit.py] osapi_max_request_body_size: BoolOpt -> IntOpt [nova.compute.api.py] find_host_timeout: not used [nova.rpc.__init__.py] allowed_rpc_exception_modules: IntOpt -> ListOpt [nova.virt.vmwareapi_conn.py] vmwareapi_api_retry_count: FloatOpt -> IntOpt [nova.volume.driver.py] num_shell_tries: StrOpt -> IntOpt num_iscsi_scan_tries: StrOpt -> IntOpt [nova.volume.driver.py] san_thin_provision: 'true' -> True san_is_local: 'false' -> False Change-Id: I07ab60b1d881c9475f4f2517a432f1e934d8ae52 --- nova/api/sizelimit.py | 6 +++--- nova/compute/api.py | 5 ----- nova/flags.py | 8 ++++---- nova/rpc/__init__.py | 2 +- nova/virt/vmwareapi_conn.py | 10 +++++----- nova/volume/driver.py | 4 ++-- nova/volume/san.py | 4 ++-- 7 files changed, 17 insertions(+), 22 deletions(-) diff --git a/nova/api/sizelimit.py b/nova/api/sizelimit.py index 69eee19bb..a74a80a98 100644 --- a/nova/api/sizelimit.py +++ b/nova/api/sizelimit.py @@ -29,9 +29,9 @@ from nova import wsgi #default request size is 112k -max_request_body_size_opt = cfg.BoolOpt('osapi_max_request_body_size', - default=114688, - help='') +max_request_body_size_opt = cfg.IntOpt('osapi_max_request_body_size', + default=114688, + help='') FLAGS = flags.FLAGS FLAGS.register_opt(max_request_body_size_opt) diff --git a/nova/compute/api.py b/nova/compute/api.py index de4042de9..6401b5829 100644 --- a/nova/compute/api.py +++ b/nova/compute/api.py @@ -51,12 +51,7 @@ from nova import volume LOG = logging.getLogger(__name__) -find_host_timeout_opt = cfg.StrOpt('find_host_timeout', - default=30, - help='Timeout after NN seconds when looking for a host.') - FLAGS = flags.FLAGS -FLAGS.register_opt(find_host_timeout_opt) flags.DECLARE('consoleauth_topic', 'nova.consoleauth') diff --git a/nova/flags.py b/nova/flags.py index aca602f7d..83a3c8535 100644 --- a/nova/flags.py +++ b/nova/flags.py @@ -410,7 +410,7 @@ global_opts = [ cfg.BoolOpt('enable_instance_password', default=True, help='Allows use of instance password during ' - 'server creation'), + 'server creation'), cfg.IntOpt('password_length', default=12, help='Length of generated instance admin passwords'), @@ -427,9 +427,9 @@ global_opts = [ default=False, help='Allow destination machine to match source for resize. ' 'Useful when testing in single-host environments.'), - cfg.StrOpt('stub_network', - default=False, - help='Stub network related code'), + cfg.BoolOpt('stub_network', + default=False, + help='Stub network related code'), cfg.IntOpt('reclaim_instance_interval', default=0, help='Interval in seconds for reclaiming deleted instances'), diff --git a/nova/rpc/__init__.py b/nova/rpc/__init__.py index f5b9fa8da..acfc10e7e 100644 --- a/nova/rpc/__init__.py +++ b/nova/rpc/__init__.py @@ -34,7 +34,7 @@ rpc_opts = [ cfg.IntOpt('rpc_response_timeout', default=60, help='Seconds to wait for a response from call or multicall'), - cfg.IntOpt('allowed_rpc_exception_modules', + cfg.ListOpt('allowed_rpc_exception_modules', default=['nova.exception'], help='Modules of exceptions that are permitted to be recreated' 'upon receiving exception data from an rpc call.'), diff --git a/nova/virt/vmwareapi_conn.py b/nova/virt/vmwareapi_conn.py index 7fde10e5d..388126c68 100644 --- a/nova/virt/vmwareapi_conn.py +++ b/nova/virt/vmwareapi_conn.py @@ -69,11 +69,11 @@ vmwareapi_opts = [ default=5.0, help='The interval used for polling of remote tasks. ' 'Used only if connection_type is vmwareapi'), - cfg.FloatOpt('vmwareapi_api_retry_count', - default=10, - help='The number of times we retry on failures, e.g., ' - 'socket error, etc. ' - 'Used only if connection_type is vmwareapi'), + cfg.IntOpt('vmwareapi_api_retry_count', + default=10, + help='The number of times we retry on failures, e.g., ' + 'socket error, etc. ' + 'Used only if connection_type is vmwareapi'), cfg.StrOpt('vmwareapi_vlan_interface', default='vmnic0', help='Physical ethernet adapter name for vlan networking'), diff --git a/nova/volume/driver.py b/nova/volume/driver.py index add975600..79ca3cab6 100644 --- a/nova/volume/driver.py +++ b/nova/volume/driver.py @@ -36,10 +36,10 @@ volume_opts = [ cfg.StrOpt('volume_group', default='nova-volumes', help='Name for the VG that will contain exported volumes'), - cfg.StrOpt('num_shell_tries', + cfg.IntOpt('num_shell_tries', default=3, help='number of times to attempt to run flakey shell commands'), - cfg.StrOpt('num_iscsi_scan_tries', + cfg.IntOpt('num_iscsi_scan_tries', default=3, help='number of times to rescan iSCSI target to find volume'), cfg.IntOpt('iscsi_num_targets', diff --git a/nova/volume/san.py b/nova/volume/san.py index e43a64a59..de30a36af 100644 --- a/nova/volume/san.py +++ b/nova/volume/san.py @@ -45,7 +45,7 @@ LOG = logging.getLogger(__name__) san_opts = [ cfg.BoolOpt('san_thin_provision', - default='true', + default=True, help='Use thin provisioning for SAN volumes?'), cfg.StrOpt('san_ip', default='', @@ -66,7 +66,7 @@ san_opts = [ default=22, help='SSH port to use with SAN'), cfg.BoolOpt('san_is_local', - default='false', + default=False, help='Execute commands locally instead of over SSH; ' 'use if the volume service is running on the SAN device'), cfg.StrOpt('san_zfs_volume_base', -- cgit