From 0285ef24dc015c1f50b61d1410c4c190baaa0a9f Mon Sep 17 00:00:00 2001 From: James Wong Date: Tue, 13 Nov 2018 10:45:04 -0500 Subject: [PATCH] using params for conversion_host https://bugzilla.redhat.com/show_bug.cgi?id=1628489 --- app/models/conversion_host.rb | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/app/models/conversion_host.rb b/app/models/conversion_host.rb index 6f803e9b3291..bcfce5b3c4eb 100644 --- a/app/models/conversion_host.rb +++ b/app/models/conversion_host.rb @@ -110,17 +110,18 @@ def self.enable_queue(params, auth_user = nil) end def self.enable(params) + op_arg = params.each_with_object([]) { |(k, v), l| l.push("#{k}=#{v}") }.join(', ') + _log.info("Enabling a conversion_host with parameters: #{op_arg}") + success = false resource_info = 'not found/invalid' - op_arg = params.each_with_object([]) { |(k, v), l| l.push("#{k}=#{v}") }.join(', ') - _log.info "Enabling a conversion_host with parameters: #{op_arg}" - - resource_type = params[:resource_type] + vddk_url = params.delete("param_v2v_vddk_package_url") resource_id = params[:resource_id] + resource_type = params[:resource_type] resource = resource_type.constantize.find(resource_id) - success = create!(:resource => resource) + success = create!(params) resource_info = "type=#{params[:resource_type]} id=#{params[:resource_id]}" ensure notify_configuration_result('enable', success, resource_info) @@ -137,7 +138,7 @@ def disable(params) resource_info = "type=#{resource.class.name} id=#{resource.id}" op_arg = params.each_with_object([]) { |(k, v), l| l.push("#{k}=#{v}") }.join(', ') - _log.info "Disabling a conversion_host with parameters: #{op_arg}" + _log.info("Disabling a conversion_host with parameters: #{op_arg}") success = destroy ensure