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

Rename 'Ansible Tower' to 'Ansible Automation Platform' #318

Merged
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
Original file line number Diff line number Diff line change
Expand Up @@ -52,15 +52,15 @@ def self.ems_type
end

def self.description
@description ||= "Ansible Tower Automation".freeze
@description ||= "Ansible Automation Platform".freeze
end

def self.catalog_types
{"generic_ansible_tower" => N_("Ansible Tower")}
{"generic_ansible_tower" => N_("Ansible Automation Platform")}
end

def self.display_name(number = 1)
n_('Automation Manager (Ansible Tower)', 'Automation Managers (Ansible Tower)', number)
n_('Automation Manager (Ansible Automation Platform)', 'Automation Managers (Ansible Automation Platform)', number)
end

def name
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,8 @@ def run_with_miq_job(options, userid = nil)
end

def self.display_name(number = 1)
n_('Job Template (Ansible Tower)', 'Job Templates (Ansible Tower)', number)
n_('Job Template (Ansible Automation Platform)', 'Job Templates (Ansible Automation Platform)', number)
Copy link
Member

@agrare agrare Dec 11, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

For a follow-up but I wonder how many of these can be dropped if we just did

Suggested change
n_('Job Template (Ansible Automation Platform)', 'Job Templates (Ansible Automation Platform)', number)
n_("Job Template (#{module_parent.description})", "Job Templates (#{module_parent.description})", number)

in the base AWX class

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Because there's the n_, you can't use interpolation, but you could do:

Suggested change
n_('Job Template (Ansible Automation Platform)', 'Job Templates (Ansible Automation Platform)', number)
n_('Job Template (%{provider_description}', 'Job Templates (%{provider_description)', number % {:provider_description => module_parent.description}

end

FRIENDLY_NAME = 'Ansible Tower Job Template'.freeze
FRIENDLY_NAME = 'Ansible Automation Platform Job Template'.freeze
end
Original file line number Diff line number Diff line change
Expand Up @@ -5,5 +5,5 @@ class ManageIQ::Providers::AnsibleTower::AutomationManager::ConfigurationScriptS

supports :create

FRIENDLY_NAME = 'Ansible Tower Project'.freeze
FRIENDLY_NAME = 'Ansible Automation Platform Project'.freeze
end
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,8 @@ def run_with_miq_job(options, userid = nil)
end

def self.display_name(number = 1)
n_('Workflow Template (Ansible Tower)', 'Workflow Templates (Ansible Tower)', number)
n_('Workflow Template (Ansible Automation Platform)', 'Workflow Templates (Ansible Automation Platform)', number)
end

FRIENDLY_NAME = 'Ansible Tower Workflow Job Template'.freeze
FRIENDLY_NAME = 'Ansible Automation Platform Workflow Job Template'.freeze
end
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,6 @@ class ManageIQ::Providers::AnsibleTower::AutomationManager::ConfiguredSystem <
ManageIQ::Providers::Awx::AutomationManager::ConfiguredSystem

def self.display_name(number = 1)
n_('Configured System (Ansible Tower)', 'Configured Systems (Ansible Tower)', number)
n_('Configured System (Ansible Automation Platform)', 'Configured Systems (Ansible Automation Platform)', number)
end
end
Original file line number Diff line number Diff line change
Expand Up @@ -10,5 +10,5 @@ class ManageIQ::Providers::AnsibleTower::AutomationManager::Credential < ManageI

supports :create

FRIENDLY_NAME = 'Ansible Tower Credential'.freeze
FRIENDLY_NAME = 'Ansible Automation Platform Credential'.freeze
end
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

class ManageIQ::Providers::AnsibleTower::AutomationManager::Job < ManageIQ::Providers::Awx::AutomationManager::Job
def self.display_name(number = 1)
n_('Ansible Tower Job', 'Ansible Tower Jobs', number)
n_('Ansible Automation Platform Job', 'Ansible Automation Platform Jobs', number)
end

def refresh_ems
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,6 @@ class ManageIQ::Providers::AnsibleTower::AutomationManager::Playbook <
has_many :jobs, :class_name => 'OrchestrationStack', :foreign_key => :configuration_script_base_id

def self.display_name(number = 1)
n_('Playbook (Ansible Tower)', 'Playbooks (Ansible Tower)', number)
n_('Playbook (Ansible Automation Platform)', 'Playbooks (Ansible Automation Platform)', number)
end
end
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ class ManageIQ::Providers::AnsibleTower::AutomationManager::WorkflowJob <
alias jobs orchestration_stacks

def self.display_name(number = 1)
n_('Ansible Tower Workflow Job', 'Ansible Tower Workflow Jobs', number)
n_('Ansible Automation Platform Workflow Job', 'Ansible Automation Platform Workflow Jobs', number)
end

def raw_status
Expand Down
2 changes: 1 addition & 1 deletion lib/manageiq/providers/ansible_tower/engine.rb
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ def self.vmdb_plugin?
end

def self.plugin_name
_('Ansible Tower Provider')
_('Ansible Automation Platform Provider')
end

def self.init_loggers
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,35 +25,35 @@

describe ".create_from_params" do
it "delegates endpoints, zone, name to provider" do
params = {:zone => FactoryBot.create(:zone), :name => "Ansible Tower"}
params = {:zone => FactoryBot.create(:zone), :name => "Ansible Automation Platform"}
endpoints = [{"role" => "default", "url" => "https://tower", "verify_ssl" => 0}]
authentications = [{"authtype" => "default", "userid" => "admin", "password" => "smartvm"}]

automation_manager = described_class.create_from_params(params, endpoints, authentications)

expect(automation_manager.provider.name).to eq("Ansible Tower")
expect(automation_manager.provider.name).to eq("Ansible Automation Platform")
expect(automation_manager.provider.endpoints.count).to eq(1)
end
end

describe "#edit_with_params" do
let(:automation_manager) do
FactoryBot.build(:automation_manager_ansible_tower, :name => "Ansible Tower", :url => "https://localhost")
FactoryBot.build(:automation_manager_ansible_tower, :name => "Ansible Automation Platform", :url => "https://localhost")
end

it "updates the provider" do
params = {:zone => FactoryBot.create(:zone), :name => "Ansible Tower 2"}
params = {:zone => FactoryBot.create(:zone), :name => "Ansible Automation Platform 2"}
endpoints = [{"role" => "default", "url" => "https://tower", "verify_ssl" => 0}]
authentications = [{"authtype" => "default", "userid" => "admin", "password" => "smartvm"}]

provider = automation_manager.provider
expect(provider.name).to eq("Ansible Tower")
expect(provider.name).to eq("Ansible Automation Platform")
expect(provider.url).to eq("https://localhost")

automation_manager.edit_with_params(params, endpoints, authentications)

provider.reload
expect(provider.name).to eq("Ansible Tower 2")
expect(provider.name).to eq("Ansible Automation Platform 2")
expect(provider.url).to eq("https://tower")
end
end
Expand Down
Loading