diff --git a/app/controllers/provider_foreman_controller.rb b/app/controllers/provider_foreman_controller.rb index 66f142a81db..f5776c62aae 100644 --- a/app/controllers/provider_foreman_controller.rb +++ b/app/controllers/provider_foreman_controller.rb @@ -155,15 +155,15 @@ def class_for_provider_node nodes = x_node.split('-') case nodes.first when "root" then ManageIQ::Providers::ConfigurationManager - when "fr" then ManageIQ::Providers::Foreman::ConfigurationManager::ConfigurationProfile - when "cp", "cs" then ManageIQ::Providers::Foreman::ConfigurationManager::ConfiguredSystem + when "fr" then ConfigurationProfile + when "cp", "cs" then ConfiguredSystem when "xx" then case nodes.second when "fr" then ManageIQ::Providers::ConfigurationManager when "csf" then ConfiguredSystem end else - nodes.include?("unassigned") ? ManageIQ::Providers::Foreman::ConfigurationManager::ConfiguredSystem : ManageIQ::Providers::ConfigurationManager + nodes.include?("unassigned") ? ConfiguredSystem : ManageIQ::Providers::ConfigurationManager end end @@ -332,7 +332,7 @@ def default_node @show_list ? process_show_list(options) : options.merge!(update_options) @right_cell_text = _("All Configuration Management Providers") elsif x_active_tree == :configuration_manager_cs_filter_tree - options = {:model => "ManageIQ::Providers::Foreman::ConfigurationManager::ConfiguredSystem"} + options = {:model => "ConfiguredSystem"} @show_list ? process_show_list(options) : options.merge!(update_options) @right_cell_text = _("All Configured Systems") end diff --git a/app/presenters/tree_builder_configuration_manager.rb b/app/presenters/tree_builder_configuration_manager.rb index 55ec8509781..f080b4db4d3 100644 --- a/app/presenters/tree_builder_configuration_manager.rb +++ b/app/presenters/tree_builder_configuration_manager.rb @@ -1,5 +1,5 @@ class TreeBuilderConfigurationManager < TreeBuilder - has_kids_for ManageIQ::Providers::Foreman::ConfigurationManager, [:x_get_tree_cmf_kids] + has_kids_for ManageIQ::Providers::ConfigurationManager, [:x_get_tree_cmf_kids] has_kids_for ConfigurationProfile, [:x_get_tree_cpf_kids] private @@ -17,7 +17,7 @@ def root_options # Get root nodes count/array for explorer tree def x_get_tree_roots - count_only_or_objects_filtered(false, ManageIQ::Providers::Foreman::ConfigurationManager, "name", :match_via_descendants => ConfiguredSystem) + count_only_or_objects_filtered(false, ManageIQ::Providers::ConfigurationManager, "name") end def node_by_tree_id(id) @@ -29,7 +29,7 @@ def x_get_tree_cmf_kids(object, count_only) assigned_configuration_profile_objs = count_only_or_objects_filtered(count_only, ConfigurationProfile.where(:manager_id => object[:id]), - "name", :match_via_descendants => ConfiguredSystem) + "name") unassigned_configuration_profile_objs = fetch_unassigned_configuration_profile_objects(count_only, object[:id]) diff --git a/app/presenters/tree_builder_configuration_manager_configured_systems.rb b/app/presenters/tree_builder_configuration_manager_configured_systems.rb index 03896234f27..57e75f4ea72 100644 --- a/app/presenters/tree_builder_configuration_manager_configured_systems.rb +++ b/app/presenters/tree_builder_configuration_manager_configured_systems.rb @@ -1,6 +1,6 @@ class TreeBuilderConfigurationManagerConfiguredSystems < TreeBuilderConfiguredSystems def initialize(*args) - @root_class = 'ManageIQ::Providers::Foreman::ConfigurationManager::ConfiguredSystem' + @root_class = 'ConfiguredSystem' super(*args) end diff --git a/spec/controllers/provider_foreman_controller_spec.rb b/spec/controllers/provider_foreman_controller_spec.rb index 4595597e187..7aa480a4b25 100644 --- a/spec/controllers/provider_foreman_controller_spec.rb +++ b/spec/controllers/provider_foreman_controller_spec.rb @@ -347,8 +347,7 @@ allow(controller).to receive(:x_active_accord).and_return(:configuration_manager_cs_filter) allow(controller).to receive(:build_listnav_search_list) controller.params = {:id => "configuration_manager_cs_filter_accord"} - expect(controller).to receive(:get_view).with("ManageIQ::Providers::Foreman::ConfigurationManager::ConfiguredSystem", - :gtl_dbname => :cm_configured_systems, :dbname => :cm_configured_systems).and_call_original + expect(controller).to receive(:get_view).with("ConfiguredSystem", :gtl_dbname => :cm_configured_systems, :dbname => :cm_configured_systems).and_call_original allow(controller).to receive(:build_listnav_search_list) controller.send(:accordion_select) end @@ -504,8 +503,8 @@ allow_any_instance_of(User).to receive(:get_filters).and_return(user_filters) Classification.seed quota_2gb_tag = Classification.where("description" => "2GB").first - Classification.bulk_reassignment(:model => "ConfiguredSystem", - :object_ids => @configured_system.id, + Classification.bulk_reassignment(:model => "ManageIQ::Providers::Foreman::ConfigurationManager", + :object_ids => @config_mgr.id, :add_ids => quota_2gb_tag.id, :delete_ids => []) tree = TreeBuilderConfigurationManager.new(:configuration_manager_providers_tree, controller.instance_variable_get(:@sb))