From 6ced3c91f1079881af77f6998ec4ee64b88dea65 Mon Sep 17 00:00:00 2001 From: Daniel Berger Date: Thu, 28 Mar 2019 13:00:47 -0400 Subject: [PATCH 1/2] Modify enable_queue to use the base class name as the resource_type. --- app/models/conversion_host/configurations.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/models/conversion_host/configurations.rb b/app/models/conversion_host/configurations.rb index cdb77b85e94..dc24431baf7 100644 --- a/app/models/conversion_host/configurations.rb +++ b/app/models/conversion_host/configurations.rb @@ -34,7 +34,7 @@ def enable_queue(params, auth_user = nil) resource = params.delete(:resource) params[:resource_id] = resource.id - params[:resource_type] = resource.class.name + params[:resource_type] = resource.class.base_class.name queue_configuration('enable', nil, resource, params, auth_user) end From f9a16568d6d90f0c65db235ed48454c37fa06f92 Mon Sep 17 00:00:00 2001 From: Daniel Berger Date: Thu, 28 Mar 2019 13:12:05 -0400 Subject: [PATCH 2/2] Add explicit require for resolve, update params in conversion host configuration spec. --- app/models/conversion_host.rb | 2 ++ spec/models/conversion_host/configurations_spec.rb | 2 +- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/app/models/conversion_host.rb b/app/models/conversion_host.rb index 45eb7737b18..cd1f50c817f 100644 --- a/app/models/conversion_host.rb +++ b/app/models/conversion_host.rb @@ -1,3 +1,5 @@ +require 'resolv' + class ConversionHost < ApplicationRecord include NewWithTypeStiMixin include AuthenticationMixin diff --git a/spec/models/conversion_host/configurations_spec.rb b/spec/models/conversion_host/configurations_spec.rb index c58d5b50d9a..2d90432bdc6 100644 --- a/spec/models/conversion_host/configurations_spec.rb +++ b/spec/models/conversion_host/configurations_spec.rb @@ -5,7 +5,7 @@ let(:params) do { :name => 'transformer', - :resource_type => vm.class.name, + :resource_type => vm.class.base_class.name, :resource_id => vm.id, :resource => vm }