Skip to content

Commit 31c45c1

Browse files
Merge pull request #9415 from agrare/fix_configuration_job_controller_ansible_tower
Fix `ConfigurationJobController` using AnsibleTower
2 parents 6e3fa2b + d472432 commit 31c45c1

File tree

6 files changed

+16
-16
lines changed

6 files changed

+16
-16
lines changed

app/controllers/configuration_job_controller.rb

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ class ConfigurationJobController < ApplicationController
1010
include Mixins::BreadcrumbsMixin
1111

1212
def self.model
13-
ManageIQ::Providers::AnsibleTower::AutomationManager::Job
13+
ManageIQ::Providers::ExternalAutomationManager::OrchestrationStack
1414
end
1515

1616
def self.table_name
@@ -36,7 +36,7 @@ def button
3636
when "configuration_job_delete"
3737
configuration_job_delete
3838
when "configuration_job_tag"
39-
tag(ManageIQ::Providers::AnsibleTower::AutomationManager::Job)
39+
tag(self.class.model)
4040
when "configuration_job_reload"
4141
# TODO: this line is not needed when feature name "configuration_job_reload" will exist
4242
assert_privileges("configuration_job_control")
@@ -72,7 +72,6 @@ def breadcrumbs_options
7272
{
7373
:breadcrumbs => [
7474
{:title => _("Automation")},
75-
{:title => _("Ansible Tower")},
7675
{:title => _("Jobs"), :url => controller_url},
7776
],
7877
}

app/controllers/orchestration_stack_controller.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ def display_children
3131

3232
def show_list
3333
process_show_list(
34-
:named_scope => [[:without_type, 'ManageIQ::Providers::AnsibleTower::AutomationManager::Job']]
34+
:named_scope => [[:without_type, 'ManageIQ::Providers::ExternalAutomationManager::OrchestrationStack']]
3535
)
3636
end
3737

app/helpers/application_helper.rb

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -424,7 +424,8 @@ def db_to_controller(db, action = "show")
424424
"ManageIQ::Providers::CloudManager::CloudDatabase",
425425
"ManageIQ::Providers::ConfigurationManager",
426426
"ManageIQ::Providers::AnsibleTower::AutomationManager::ConfiguredSystem",
427-
"ManageIQ::Providers::AnsibleTower::AutomationManager::Job", "ConfigurationScript"
427+
"ManageIQ::Providers::ExternalAutomationManager::OrchestrationStack",
428+
"ConfigurationScript"
428429
controller = request.parameters[:controller]
429430
when "ContainerVolume"
430431
controller = "persistent_volume"

app/views/layouts/_tag_edit_items.html.haml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,8 @@
33
%h3
44
- t = {:amount => @tagitems.length, :object => ui_lookup(:model => @edit[:tagging]), :objects => ui_lookup(:models => @edit[:tagging])}
55
- case @edit[:tagging]
6-
- when "ManageIQ::Providers::AnsibleTower::AutomationManager::Job"
7-
= n_("%{amount} Ansible Tower Job Being Tagged", "%{amount} Ansible Tower Jobs Being Tagged", @tagitems.length) % t
6+
- when "ManageIQ::Providers::ExternalAutomationManager::OrchestrationStack"
7+
= n_("%{amount} Automation Job Being Tagged", "%{amount} Automation Jobs Being Tagged", @tagitems.length) % t
88
- when "ManageIQ::Providers::AnsibleTower::AutomationManager"
99
= n_("%{amount} Automation Manager (Ansible Tower) Being Tagged", "%{amount} Automation Managers (Ansible Tower) Being Tagged", @tagitems.length) % t
1010
- when "AvailabilityZone"

product/views/ManageIQ_Providers_AnsibleTower_AutomationManager_Job.yaml renamed to product/views/ManageIQ_Providers_ExternalAutomationManager_OrchestrationStack.yaml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -9,13 +9,13 @@
99
#
1010

1111
# Report title
12-
title: Ansible Tower Jobs
12+
title: Automation Jobs
1313

1414
# Menu name
15-
name: Ansible Tower Job
15+
name: Automation Job
1616

1717
# Main DB table report is based on
18-
db: ManageIQ::Providers::AnsibleTower::AutomationManager::Job
18+
db: ManageIQ::Providers::ExternalAutomationManager::OrchestrationStack
1919

2020
# Columns to fetch from the main table
2121
cols:

spec/controllers/configuration_job_controller_spec.rb

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99

1010
describe '#show' do
1111
context "instances" do
12-
let(:record) { FactoryBot.create(:ansible_tower_job) }
12+
let(:record) { FactoryBot.create(:awx_job) }
1313

1414
before do
1515
session[:settings] = {
@@ -39,7 +39,7 @@
3939
let!(:user) { stub_user(:features => :all) }
4040
before do
4141
EvmSpecHelper.create_guid_miq_server_zone
42-
@cj = FactoryBot.create(:ansible_tower_job, :name => "testJob")
42+
@cj = FactoryBot.create(:awx_job, :name => "testJob")
4343
allow(@cj).to receive(:tagged_with).with(:cat => user.userid).and_return("my tags")
4444
classification = FactoryBot.create(:classification, :name => "department", :description => "Department")
4545
@tag1 = FactoryBot.create(:classification_tag,
@@ -49,10 +49,10 @@
4949
:name => "tag2",
5050
:parent => classification)
5151
allow(Classification).to receive(:find_assigned_entries).with(@cj).and_return([@tag1, @tag2])
52-
session[:tag_db] = "ManageIQ::Providers::AnsibleTower::AutomationManager::Job"
52+
session[:tag_db] = "ManageIQ::Providers::Awx::AutomationManager::Job"
5353
edit = {
54-
:key => "ManageIQ::Providers::AnsibleTower::AutomationManager::Job_edit_tags__#{@cj.id}",
55-
:tagging => "ManageIQ::Providers::AnsibleTower::AutomationManager::Job",
54+
:key => "ManageIQ::Providers::Awx::AutomationManager::Job_edit_tags__#{@cj.id}",
55+
:tagging => "ManageIQ::Providers::Awx::AutomationManager::Job",
5656
:object_ids => [@cj.id],
5757
:current => {:assignments => []},
5858
:new => {:assignments => [@tag1.id, @tag2.id]}
@@ -84,5 +84,5 @@
8484
end
8585
end
8686

87-
include_examples '#download_summary_pdf', :ansible_tower_job
87+
include_examples '#download_summary_pdf', :awx_job
8888
end

0 commit comments

Comments
 (0)