Description of problem: Changing the worker count across our environment for ems_metrics_collector_worker from 2 to 4 (using tools/configure_server_settings.rb) caused C & U to stop function because the value was change from 2 to '4'. Subsequently miq_worker.rb:149 was trying to compare current workers [0] to ['4'] and throwing a string comparison exception. Version-Release number of selected component (if applicable): How reproducible: Steps to Reproduce: 1. ./tools/configure_server_settings.rb -s 1 -p workers/worker_base/queue_worker_base/ems_metrics_collector_worker/defaults/count -v 4 2. 3. Actual results: Changes the count to "4" as a String. Results in an exception when comparing the current worker count to the desired "4" because it's not a number. Expected results: changes the count to 4, as a number. Additional info:
Upstream PRs have been merged: https://github.com/ManageIQ/manageiq/pull/17039 https://github.com/ManageIQ/manageiq/pull/17059
QE: Upstream PRs are merged, the desired result is if you try to specify a number and it's treated as a string (how ruby handles anything in ARGV), we should yell at you: $ ./tools/configure_server_settings.rb -s1 -p workers/worker_base/queue_worker_base/ems_metrics_collector_worker/defaults/count -v 4 {:dry_run=>false, :serverid=>1, :path=>"workers/worker_base/queue_worker_base/ems_metrics_collector_worker/defaults/count", :value=>"4", :force=>false, :type=>"string", :help=>false, :serverid_given=>true, :path_given=>true, :value_given=>true} ** Using session_store: ActionDispatch::Session::MemCacheStore The new value's class String does not match the prior one's Integer. Use -t to specify the type for the provided value. Use -f to force changing this value. Note, -f may break things! See -h for examples. You are forced to 1) use -f to force the script to store the "4" value, which is what you normally don't want to do. 2) or to specify the type. $ ./tools/configure_server_settings.rb -s 1 -p workers/worker_base/queue_worker_base/ems_metrics_collector_worker/defaults/count -v 4 -t integer {:dry_run=>false, :serverid=>1, :path=>"workers/worker_base/queue_worker_base/ems_metrics_collector_worker/defaults/count", :value=>"4", :force=>false, :type=>"integer", :help=>false, :serverid_given=>true, :path_given=>true, :value_given=>true, :type_given=>true} ** Using session_store: ActionDispatch::Session::MemCacheStore Setting [workers/worker_base/queue_worker_base/ems_metrics_collector_worker/defaults/count], old value: [2], new value: [4] Done Note, --help or -h shows the possible values for the datatype: $ ./tools/configure_server_settings.rb -h USAGE: ./tools/configure_server_settings.rb -s <server id> -p <settings path separated by a /> -v <new value> Example (String): ./tools/configure_server_settings.rb -s 1 -p reporting/history/keep_reports -v 3.months Example (Integer): ./tools/configure_server_settings.rb -s 1 -p workers/worker_base/queue_worker_base/ems_metrics_collector_worker/defaults/count -v 1 -t integer Example (Boolean): ./tools/configure_server_settings.rb -s 1 -p ui/mark_translated_strings -v true -t boolean Example (Symbol): ./tools/configure_server_settings.rb -s 1 -p workers/worker_base/queue_worker_base/ems_metrics_collector_worker/defaults/poll_method -v escalate -t symbol Example (Float): ./tools/configure_server_settings.rb -s 1 -p capacity/profile/1/vcpu_commitment_ratio -v 1.5 -t float -d, --dry-run Dry Run -s, --serverid=<i> Server Id -p, --path=<s> Path within advanced settings hash -v, --value=<s> New Value for setting -f, --force Force change value regardless of type -t, --type=<s> Type of value provided, ["string", "integer", "boolean", "symbol", "float"] (default: string) -h, --help Show this message
Verified on 5.10.0.15.