Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Renaming of provider_foreman files, code to configuration_manager #6756

Closed
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions app/controllers/application_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -431,7 +431,7 @@ def report_data
@view.table = filter_parent_name_tenant(@view.table)
end

# Foreman has some unassigned rows which needs to be added after view is fetched
# Configuration Manager has some unassigned rows which needs to be added after view is fetched
if options && options[:unassigned_profile_row] && options[:unassigned_configuration_profile]
options[:unassigned_profile_row][:id] ||= options[:unassigned_profile_row]['manager_id']
@view.table.data.push(options[:unassigned_profile_row])
Expand Down Expand Up @@ -1987,7 +1987,7 @@ def controller_for_common_methods
"vm"
when 'automation_manager'
"automation_manager_provider"
when 'provider_foreman'
when 'configuration_manager'
"configuration_manager_provider"
when "generic_object_definition" # tagging for nested list on the generic object class
"generic_object"
Expand Down
2 changes: 1 addition & 1 deletion app/controllers/application_controller/ci_processing.rb
Original file line number Diff line number Diff line change
Expand Up @@ -306,7 +306,7 @@ def manager_button_operation(method, display_name)
def process_managers(managers, task)
controller_class = request.parameters[:controller]
provider_class = case controller_class
when 'provider_foreman' then ManageIQ::Providers::ConfigurationManager
when 'configuration_manager' then ManageIQ::Providers::ConfigurationManager
when 'automation_manager' then ManageIQ::Providers::AutomationManager
end

Expand Down
4 changes: 3 additions & 1 deletion app/controllers/application_controller/explorer.rb
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,9 @@ def x_history
'start' => :s1, 'stop' => :s1, 'suspend' => :s1,
'reset' => :s1, 'terminate' => :s1, 'pause' => :s1,
'shelve' => :s1, 'shelve_offload' => :s1, 'chargeback' => :s1,
'foreman_pause' => :s1, 'foreman_resume' => :s1, 'manager_pause' => :s1,
'configuration_manager_pause' => :s1,
'configuration_manager_resume' => :s1,
'manager_pause' => :s1,
'manager_resume' => :s1,

# group 2
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -887,7 +887,7 @@ def prov_set_form_vars(req = nil)
@edit[:new] = @edit[:new].merge(pre_prov_values.reject { |k| @edit[:new].key?(k) })
end

if @edit[:wf].kind_of?(ManageIQ::Providers::Foreman::ConfigurationManager::ProvisionWorkflow) ||
if @edit[:wf].kind_of?(ManageIQ::Providers::ConfigurationManager::ProvisionWorkflow) ||
@edit[:wf].kind_of?(PhysicalServerProvisionWorkflow)
# BD TODO
else
Expand Down Expand Up @@ -984,7 +984,7 @@ def workflow_instance_from_vars(req)
elsif @edit[:org_controller] == "configured_system"
@edit[:prov_type] = "ConfiguredSystem"
@edit[:new][:src_configured_system_ids] = params[:prov_id].kind_of?(Array) ? params[:prov_id] : [params[:prov_id]]
wf_type = ManageIQ::Providers::Foreman::ConfigurationManager::ProvisionWorkflow
wf_type = ManageIQ::Providers::ConfigurationManager::ProvisionWorkflow
elsif @edit[:org_controller] == "physical_server"
@edit[:prov_type] = "PhysicalServer"
@edit[:new][:src_configured_system_ids] = params[:prov_id].kind_of?(Array) ? params[:prov_id] : [params[:prov_id]]
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
class ProviderForemanController < ApplicationController
class ConfigurationManagerController < ApplicationController
before_action :check_privileges
before_action :get_session_data

Expand All @@ -17,12 +17,12 @@ def self.model
end

def self.table_name
@table_name ||= "provider_foreman"
@table_name ||= "configuration_manager"
end

def self.model_to_name(provmodel)
if provmodel.include?("ManageIQ::Providers::Foreman")
Dictionary.gettext('foreman', :type => :ui_title, :translate => false)
if provmodel.include?("ManageIQ::Providers::ConfigurationManager")
Dictionary.gettext('ConfigurationManager', :type => :ui_title, :translate => false)
end
end

Expand All @@ -39,11 +39,11 @@ def manager_prefix
end

def privilege_prefix
'provider_foreman'
'configuration_manager'
end

def provision
assert_privileges("provider_foreman_configured_system_provision") if x_active_accord == :configuration_manager_providers
assert_privileges("configuration_manager_configured_system_provision") if x_active_accord == :configuration_manager_providers
assert_privileges("configured_system_provision") if x_active_accord == :configuration_manager_cs_filter
provisioning_ids = find_records_with_rbac(ConfiguredSystem, checked_or_params).ids

Expand Down Expand Up @@ -206,11 +206,11 @@ def provider_active_tree?

private

def provider_foreman_pause
def configuration_manager_pause
pause_or_resume_emss(:pause => true)
end

def provider_foreman_resume
def configuration_manager_resume
pause_or_resume_emss(:resume => true)
end

Expand All @@ -220,7 +220,7 @@ def textual_group_list
helper_method :textual_group_list

def provider_class
ManageIQ::Providers::Foreman::Provider
ManageIQ::Providers::ConfigurationManager
end

def features
Expand Down Expand Up @@ -252,11 +252,11 @@ def get_node_info(treenodeid, show_list = true)
end

options = case model
when "ManageIQ::Providers::Foreman::ConfigurationManager"
when "ManageIQ::Providers::ConfigurationManager"
provider_list(id, model)
when "ConfigurationProfile"
configuration_profile_node(id, model)
when "ManageIQ::Providers::Foreman::ConfigurationManager::ConfiguredSystem", "ConfiguredSystem"
when "ManageIQ::Providers::ConfigurationManager::ConfiguredSystem", "ConfiguredSystem"
configured_system_list(id, model)
when "MiqSearch"
miq_search_node
Expand Down Expand Up @@ -285,8 +285,8 @@ def provider_node(id, model)
else
@no_checkboxes = true
case @record.type
when "ManageIQ::Providers::Foreman::ConfigurationManager"
options = {:model => "ConfigurationProfile", :match_via_descendants => 'ConfiguredSystem', :named_scope => [[:with_manager, provider.id]]}
when "ManageIQ::Providers::Foreman::ConfigurationManager", "ManageIQ::Providers::CloudAutomationManager::ConfigurationManager"
options = {:model => "ConfigurationProfile", :named_scope => [[:with_manager, provider.id]]}
@show_list ? process_show_list(options) : options.merge!(update_options)
unassigned_profiles = add_unassigned_configuration_profile_record(provider.id)
options.merge!(unassigned_profiles) unless unassigned_profiles.nil?
Expand Down Expand Up @@ -355,14 +355,14 @@ def configuration_profile_record?(node = x_node)
type && %w[ConfigurationProfile].include?(TreeBuilder.get_model_for_prefix(type))
end

def foreman_provider_record?(node = x_node)
def configuration_manager_record?(node = x_node)
node = node.split("-").last if node.split("-").first == 'xx'
type, _id = node.split("-")
type && ["ManageIQ::Providers::Foreman::ConfigurationManager"].include?(TreeBuilder.get_model_for_prefix(type))
type && ["ManageIQ::Providers::ConfigurationManager"].include?(TreeBuilder.get_model_for_prefix(type))
end

def provider_record?(node = x_node)
foreman_provider_record?(node)
configuration_manager_record?(node)
end

def search_text_type(node)
Expand Down
2 changes: 1 addition & 1 deletion app/controllers/mixins/manager_controller_mixin.rb
Original file line number Diff line number Diff line change
Expand Up @@ -501,7 +501,7 @@ def construct_edit_for_audit
end

def breadcrumb_name(_model)
"#{ui_lookup(:ui_title => 'foreman')} #{_('Provider')}"
"#{ui_lookup(:ui_title => 'ConfigurationManager')} #{_('Provider')}"
end

def tagging_explorer_controller?
Expand Down
2 changes: 1 addition & 1 deletion app/controllers/restful_redirect_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ def index
record = ExtManagementSystem.find_by(:id => params[:id])
if record
if %w[ManageIQ::Providers::ConfigurationManager].include?(record.type) || record.type.starts_with?('ManageIQ::Providers::Foreman')
redirect_to(:controller => 'provider_foreman', :action => 'show', :id => params[:id])
redirect_to(:controller => 'configuration_manager', :action => 'show', :id => params[:id])
elsif %w[ManageIQ::Providers::AnsibleTower::AutomationManager].include?(record.type)
redirect_to(:controller => 'automation_manager', :action => 'show', :id => params[:id])
elsif %w[ManageIQ::Providers::EmbeddedAnsible::AutomationManager].include?(record.type)
Expand Down
14 changes: 7 additions & 7 deletions app/helpers/application_helper.rb
Original file line number Diff line number Diff line change
Expand Up @@ -219,7 +219,7 @@ def url_for_db(db, action = "show", item = nil)
elsif @host && %w[Patch GuestApplication].include?(db)
return url_for_only_path(:controller => "host", :action => @lastaction, :id => @host, :show => @id)
elsif %w[ConfiguredSystem ConfigurationProfile].include?(db)
return url_for_only_path(:controller => "provider_foreman", :action => @lastaction, :id => @record, :show => @id)
return url_for_only_path(:controller => "configuration_manager", :action => @lastaction, :id => @record, :show => @id)
else
controller, action = db_to_controller(db, action)
return url_for_only_path(:controller => controller, :action => action, :id => @id)
Expand Down Expand Up @@ -282,12 +282,12 @@ def view_to_url(view, parent = nil)
# this is to handle link to a vm in vm explorer from service explorer
return url_for_only_path(:controller => "vm_or_template", :action => "show") + "/"
elsif %w[ConfigurationProfile].include?(view.db) &&
request.parameters[:controller] == "provider_foreman"
request.parameters[:controller] == "configuration_manager"
return url_for_only_path(:action => action, :id => nil) + "/"
elsif %w[ManageIQ::Providers::AutomationManager::InventoryRootGroup EmsFolder].include?(view.db) &&
request.parameters[:controller] == "automation_manager"
return url_for_only_path(:action => action, :id => nil) + "/"
elsif %w[ConfiguredSystem].include?(view.db) && (request.parameters[:controller] == "provider_foreman" || request.parameters[:controller] == "automation_manager")
elsif %w[ConfiguredSystem].include?(view.db) && (request.parameters[:controller] == "configuration_manager" || request.parameters[:controller] == "automation_manager")
return url_for_only_path(:action => action, :id => nil) + "/"
elsif %w[MiqWidget
ConfigurationScript
Expand Down Expand Up @@ -791,7 +791,7 @@ def display_adv_search?
orchestration_stack
persistent_volume
physical_server
provider_foreman
configuration_manager
resource_pool
retired
security_group
Expand Down Expand Up @@ -912,9 +912,9 @@ def model_from_active_tree(tree)
when :automation_manager_cs_filter_tree
"ManageIQ::Providers::AnsibleTower::AutomationManager::ConfiguredSystem"
when :configuration_manager_cs_filter_tree
"ManageIQ::Providers::Foreman::ConfigurationManager::ConfiguredSystem"
"ManageIQ::Providers::ConfigurationManager::ConfiguredSystem"
when :configuration_manager_providers_tree
"ManageIQ::Providers::Foreman::ConfigurationManager" if x_node.include?("fr")
"ManageIQ::Providers::ConfigurationManager" if x_node.include?("fr")
"ManageIQ::Providers::ConfigurationManager" if x_node == "root"
when :instances_filter_tree
"ManageIQ::Providers::CloudManager::Vm"
Expand All @@ -938,7 +938,7 @@ def configuration_manager_scripts_tree(tree)
when :automation_manager_cs_filter_tree, :automation_manager_providers_tree
"ManageIQ::Providers::AnsibleTower::AutomationManager::ConfiguredSystem"
when :configuration_manager_cs_filter_tree
"ManageIQ::Providers::Foreman::ConfigurationManager::ConfiguredSystem"
"ManageIQ::Providers::ConfigurationManager::ConfiguredSystem"
when :configuration_scripts_tree
"ConfigurationScript"
end
Expand Down
2 changes: 1 addition & 1 deletion app/helpers/application_helper/page_layouts.rb
Original file line number Diff line number Diff line change
Expand Up @@ -208,7 +208,7 @@ def show_adv_search?
orchestration_stack
persistent_volume
physical_server
provider_foreman
configuration_manager
resource_pool
retired
security_group
Expand Down
2 changes: 1 addition & 1 deletion app/helpers/application_helper/title.rb
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ def title_from_layout(layout)
_("Reports")
when "ops"
_("Configuration")
when "provider_foreman"
when "configuration_manager"
_("Configuration Management")
when "pxe"
_("PXE")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ class ApplicationHelper::Toolbar::ConfigurationManagerProviderCenter < Applicati
:enabled => true,
:items => [
button(
:provider_foreman_refresh_provider,
:configuration_manager_refresh_provider,
'fa fa-refresh fa-lg',
N_('Refresh relationships for all items related to this Provider'),
N_('Refresh Relationships and Power states'),
Expand All @@ -17,13 +17,13 @@ class ApplicationHelper::Toolbar::ConfigurationManagerProviderCenter < Applicati
:klass => ApplicationHelper::Button::EmsRefresh),
separator,
button(
:provider_foreman_edit_provider,
:configuration_manager_edit_provider,
'pficon pficon-edit fa-lg',
t = N_('Edit this Provider'),
t,
:url => "edit"),
button(
:provider_foreman_delete_provider,
:configuration_manager_delete_provider,
'pficon pficon-delete fa-lg',
t = N_('Remove this Provider from Inventory'),
t,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ class ApplicationHelper::Toolbar::ConfigurationManagerProvidersCenter < Applicat
:enabled => true,
:items => [
button(
:provider_foreman_refresh_provider,
:configuration_manager_refresh_provider,
'fa fa-refresh fa-lg',
N_('Refresh relationships for all items related to the selected items'),
N_('Refresh Relationships and Power states'),
Expand All @@ -20,14 +20,14 @@ class ApplicationHelper::Toolbar::ConfigurationManagerProvidersCenter < Applicat
:onwhen => "1+"),
separator,
button(
:provider_foreman_add_provider,
:configuration_manager_add_provider,
'pficon pficon-add-circle-o fa-lg',
t = N_('Add a new Provider'),
t,
:enabled => true,
:url => "new"),
button(
:provider_foreman_edit_provider,
:configuration_manager_edit_provider,
'pficon pficon-edit fa-lg',
N_('Select a single item to edit'),
N_('Edit Selected item'),
Expand All @@ -37,7 +37,7 @@ class ApplicationHelper::Toolbar::ConfigurationManagerProvidersCenter < Applicat
:enabled => false,
:onwhen => "1"),
button(
:provider_foreman_delete_provider,
:configuration_manager_delete_provider,
'pficon pficon-delete fa-lg',
t = N_('Remove selected items from Inventory'),
t,
Expand All @@ -63,7 +63,7 @@ class ApplicationHelper::Toolbar::ConfigurationManagerProvidersCenter < Applicat
button(
:configuration_manager_provider_tag,
'pficon pficon-edit fa-lg',
N_('Edit Tags for this Foreman Provider'),
N_('Edit Tags for this Configuration Manager Provider'),
N_('Edit Tags'),
:url_parms => "main_div",
:send_checked => true,
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
module ApplicationHelper::Toolbar::ConfigurationScripts::PolicyMixin
def self.included(included_class)
included_class.button_group('provider_foreman_policy',
[included_class.select(:provider_foreman_policy_choice,
included_class.button_group('configuration_manager_policy',
[included_class.select(:configuration_manager_policy_choice,
nil,
t = N_('Policy'),
t,
Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
module ApplicationHelper::Toolbar::ConfiguredSystem::Foreman::LifecycleMixin
module ApplicationHelper::Toolbar::ConfiguredSystem::ConfigurationManager::LifecycleMixin
def self.included(included_class)
included_class.button_group('provider_foreman_lifecycle', [
included_class.button_group('configuration_manager_lifecycle', [
included_class.select(
:provider_foreman_lifecycle_choice,
:configuration_manager_lifecycle_choice,
nil,
N_('Lifecycle'),
:enabled => true,
Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
module ApplicationHelper::Toolbar::ConfiguredSystem::Foreman::PolicyMixin
module ApplicationHelper::Toolbar::ConfiguredSystem::ConfigurationManager::PolicyMixin
def self.included(included_class)
included_class.button_group('provider_foreman_policy', [
included_class.button_group('configuration_manager_policy', [
included_class.select(
:provider_foreman_policy_choice,
:configuration_manager_policy_choice,
nil,
N_('Policy'),
:items => [
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
class ApplicationHelper::Toolbar::ConfiguredSystemsCenter < ApplicationHelper::Toolbar::Basic
include ApplicationHelper::Toolbar::ConfiguredSystem::Foreman::LifecycleMixin
include ApplicationHelper::Toolbar::ConfiguredSystem::Foreman::PolicyMixin
include ApplicationHelper::Toolbar::ConfiguredSystem::ConfigurationManager::LifecycleMixin
include ApplicationHelper::Toolbar::ConfiguredSystem::ConfigurationManager::PolicyMixin
end
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
class ApplicationHelper::Toolbar::UnassignedProfilesGroupCenter < ApplicationHelper::Toolbar::Basic
include ApplicationHelper::Toolbar::ConfiguredSystem::Foreman::LifecycleMixin
include ApplicationHelper::Toolbar::ConfiguredSystem::Foreman::PolicyMixin
include ApplicationHelper::Toolbar::ConfiguredSystem::ConfigurationManager::LifecycleMixin
include ApplicationHelper::Toolbar::ConfiguredSystem::ConfigurationManager::PolicyMixin
end
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
class ApplicationHelper::Toolbar::XProviderForemanForemanConfiguredSystemCenter < ApplicationHelper::Toolbar::Basic
class ApplicationHelper::Toolbar::XConfigurationManagerConfiguredSystemCenter < ApplicationHelper::Toolbar::Basic
button_group('record_summary', [
select(
:provider_foreman_lifecycle_choice,
:configuration_manager_lifecycle_choice,
nil,
t = N_('Lifecycle'),
t,
:enabled => true,
:items => [
button(
:provider_foreman_configured_system_provision,
:configuration_manager_configured_system_provision,
'pficon pficon-add-circle-o fa-lg',
t = N_('Provision Configured System'),
t,
Expand All @@ -19,7 +19,7 @@ class ApplicationHelper::Toolbar::XProviderForemanForemanConfiguredSystemCenter
]
),
select(
:provider_foreman_policy_choice,
:configuration_manager_policy_choice,
nil,
t = N_('Policy'),
t,
Expand Down
Loading