From 6cc6801d020c65aa673f841b0d7bdf4632c12db1 Mon Sep 17 00:00:00 2001 From: Adam Grare Date: Mon, 30 Sep 2024 09:41:26 -0400 Subject: [PATCH] Fix Vm#set_description error ``` >> vm.set_description("new-description") app/models/vm_or_template.rb:380:in `merge': no implicit conversion of String into Hash (TypeError) options = {:user_event => "Console Request Action [#{verb}], VM [#{name}]"}.merge(options) ^^^^^^^ from app/models/vm_or_template.rb:380:in `run_command_via_parent' from /home/grare/adam/src/manageiq/manageiq-providers-vmware/app/models/manageiq/providers/vmware/infra_manager/vm_or_template_shared/operations.rb:43:in `raw_set_description' from app/models/vm_or_template/operations.rb:95:in `set_description' from (irb):12:in `
' from :187:in `loop' from railties (7.0.8.4) lib/rails/commands/console/console_command.rb:74:in `start' from railties (7.0.8.4) lib/rails/commands/console/console_command.rb:19:in `start' from railties (7.0.8.4) lib/rails/commands/console/console_command.rb:106:in `perform' from thor (1.3.2) lib/thor/command.rb:28:in `run' from thor (1.3.2) lib/thor/invocation.rb:127:in `invoke_command' from thor (1.3.2) lib/thor.rb:538:in `dispatch' from railties (7.0.8.4) lib/rails/command/base.rb:87:in `perform' from railties (7.0.8.4) lib/rails/command.rb:48:in `invoke' from railties (7.0.8.4) lib/rails/commands.rb:18:in `
' from /usr/lib/ruby/3.3.0/bundled_gems.rb:75:in `require' from /usr/lib/ruby/3.3.0/bundled_gems.rb:75:in `block (2 levels) in replace_require' ... 2 levels... ``` --- app/models/manageiq/providers/vmware/infra_manager.rb | 4 ++-- .../vmware/infra_manager/vm_or_template_shared/operations.rb | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/app/models/manageiq/providers/vmware/infra_manager.rb b/app/models/manageiq/providers/vmware/infra_manager.rb index bf50f89d1..862c1981a 100644 --- a/app/models/manageiq/providers/vmware/infra_manager.rb +++ b/app/models/manageiq/providers/vmware/infra_manager.rb @@ -656,9 +656,9 @@ def vm_quick_stats(obj, options = {}) end alias_method :host_quick_stats, :vm_quick_stats - def vm_set_description(vm, new_description, options = {}) + def vm_set_description(vm, options = {}) options[:spec] = VimHash.new("VirtualMachineConfigSpec") do |spec| - spec.annotation = new_description + spec.annotation = options.delete(:new_description) end vm_reconfigure(vm, options) diff --git a/app/models/manageiq/providers/vmware/infra_manager/vm_or_template_shared/operations.rb b/app/models/manageiq/providers/vmware/infra_manager/vm_or_template_shared/operations.rb index 507c92120..734f56da2 100644 --- a/app/models/manageiq/providers/vmware/infra_manager/vm_or_template_shared/operations.rb +++ b/app/models/manageiq/providers/vmware/infra_manager/vm_or_template_shared/operations.rb @@ -40,7 +40,7 @@ def raw_rename(new_name) end def raw_set_description(new_description) - run_command_via_parent(:vm_set_description, new_description) + run_command_via_parent(:vm_set_description, :new_description => new_description) end def log_user_event(event_message)