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

ConfigurationWorkflow to exist only in AutomationManager space #17720

Merged
merged 2 commits into from
Jul 31, 2018
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
5 changes: 0 additions & 5 deletions app/models/configuration_workflow.rb

This file was deleted.

1 change: 0 additions & 1 deletion app/models/manageiq/providers/automation_manager.rb
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@ class ManageIQ::Providers::AutomationManager < ManageIQ::Providers::BaseManager
has_many :configured_systems, :dependent => :destroy, :foreign_key => "manager_id"
has_many :configuration_profiles, :dependent => :destroy, :foreign_key => "manager_id"
has_many :configuration_scripts, :dependent => :destroy, :foreign_key => "manager_id"
has_many :configuration_workflows, :dependent => :destroy, :foreign_key => "manager_id", :inverse_of => :manager
has_many :credentials, :class_name => "ManageIQ::Providers::AutomationManager::Authentication",
:as => :resource, :dependent => :destroy
has_many :inventory_groups, :dependent => :destroy, :foreign_key => "ems_id", :inverse_of => :manager
Expand Down

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,8 @@ class ManageIQ::Providers::EmbeddedAnsible::AutomationManager < ManageIQ::Provid
require_nested :Refresher
require_nested :RefreshWorker

has_many :configuration_workflows, :dependent => :destroy, :foreign_key => "manager_id", :inverse_of => :manager
Copy link
Member

Choose a reason for hiding this comment

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

Is this needed?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Without this, a bunch specs will fail due to the Inventory collection logic. I can work on a separate PR just to remove this

Copy link
Contributor

Choose a reason for hiding this comment

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

Right now, the persistor and parser are shared between Embedded and Tower. So not doing this, we will need to add a bunch of conditions to differentiate the 2, or partially separate them. So adding this is actually nicer :-)

So I am fine with Embedded responding to .configuration_workflows, but never refreshing it. (performance wise, this will be recognized as noop in embedded refresh and skipped fast)


def self.ems_type
@ems_type ||= "embedded_ansible_automation".freeze
end
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
class ManageIQ::Providers::EmbeddedAnsible::AutomationManager::ConfigurationWorkflow < ManageIQ::Providers::EmbeddedAutomationManager::ConfigurationWorkflow
class ManageIQ::Providers::EmbeddedAnsible::AutomationManager::ConfigurationWorkflow < ManageIQ::Providers::EmbeddedAutomationManager::ConfigurationScript
include ManageIQ::Providers::AnsibleTower::Shared::AutomationManager::ConfigurationWorkflow
end

This file was deleted.

This file was deleted.

2 changes: 2 additions & 0 deletions locale/en.yml
Original file line number Diff line number Diff line change
Expand Up @@ -704,6 +704,7 @@ en:
ContainerQuota: Container Quota
CustomButton: Button
CustomButtonSet: Button Group
ConfigurationScript: Template (Ansible Tower)
ConfigurationScriptSource: Repository
Container: Container
ContainerPerformance: Performance - Container
Expand Down Expand Up @@ -774,6 +775,7 @@ en:
ManageIQ::Providers::AnsibleTower::AutomationManager::VmwareCredential: Credential (VMware)
ManageIQ::Providers::AnsibleTower::AutomationManager: Automation Manager (Ansible Tower)
ManageIQ::Providers::AnsibleTower::AutomationManager::ConfigurationScript: Job Template (Ansible Tower)
ManageIQ::Providers::AnsibleTower::AutomationManager::ConfigurationWorkflow: Workflow Template (Ansible Tower)
ManageIQ::Providers::AnsibleTower::AutomationManager::Playbook: Playbook (Ansible Tower)
ManageIQ::Providers::Foreman::ConfigurationManager: Configuration Manager (Foreman)
ManageIQ::Providers::ConfigurationManager: Configuration Manager
Expand Down
4 changes: 3 additions & 1 deletion spec/factories/configuration_script.rb
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,9 @@
:parent => :configuration_script_payload

factory :configuration_script, :class => "ConfigurationScript", :parent => :configuration_script_base
factory :configuration_workflow, :class => "ConfigurationWorkflow", :parent => :configuration_script_base
factory :configuration_workflow,
:class => "ManageIQ::Providers::AnsibleTower::AutomationManager::ConfigurationWorkflow",
:parent => :configuration_script
factory :ansible_configuration_script,
:class => "ManageIQ::Providers::AnsibleTower::AutomationManager::ConfigurationScript",
:parent => :configuration_script
Expand Down