-
Notifications
You must be signed in to change notification settings - Fork 898
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
Service Playbook updates fqname and configuration_template #15007
Conversation
@miq-bot add_label bug, providers/ansible_tower, services, fine/yes, blocker |
@bzwei - I was testing this with the following scenario:
With part 4 I ran into this error: I'm not entirely sure the error came from your changes - but I believe it failed here. I'd be interested if you can duplicate it on your environment. |
@syncrou please test with latest commit. |
@@ -132,7 +132,7 @@ def self.validate_config_info(info) | |||
|
|||
|
|||
def job_template(action) | |||
resource_actions.find_by(:action => action.to_s.capitalize).try(:configuration_template) | |||
resource_actions.find_by(:action => action.capitalize).try(:configuration_template) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I believe this will fail without the to_s
. There may be more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I tested and proved to_s
can be dropped.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
With the latest changes I'm not able to get as far as before.
Using the following scenario:
- Create new Ansible Playbook catalog item with no retirement playbook.
- Edit the catalog item and add a new retirement playbook.
- Edit the catalog item and remove the retirement playbook.
- Delete the entire catalog item.
I am failing at 2. The retirement resource_action is created:
But the retirement playbook is not created in Tower:
@@ -225,6 +220,7 @@ def update_job_templates(name, description, config_info, auth_user) | |||
ManageIQ::Providers::EmbeddedAnsible::AutomationManager::ConfigurationScript.update_in_provider_queue(tower.id, params, auth_user) | |||
else | |||
delete_job_templates([job_template]) | |||
resource_actions.find_by(:action => action.capitalize).update_attributes(:configuration_template => nil) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What do you think about passing the action
to delete_job_templates
? Then line 223 could be deleted.
def delete_job_templates(job_templates, action = nil)
auth_user = User.current_userid || 'system'
job_templates.each do |job_template|
ManageIQ::Providers::EmbeddedAnsible::AutomationManager::ConfigurationScript
.delete_in_provider_queue(job_template.manager.id, { :manager_ref => job_template.manager_ref }, auth_user)
end
resource_actions.find_by(:action => action.capitalize).update_attributes(:configuration_template => nil) if action
end
6d0ad8d
to
2dc391f
Compare
Checked commits bzwei/manageiq@dcece3e~...2dc391f with ruby 2.2.6, rubocop 0.47.1, and haml-lint 0.20.0 |
👍 Looks good to me |
Service Playbook updates fqname and configuration_template (cherry picked from commit fc36cd5) https://bugzilla.redhat.com/show_bug.cgi?id=1448868
Fine backport details:
|
Multiple problems were discovered while debugging https://bugzilla.redhat.com/show_bug.cgi?id=1447701
:fqname
forresource_actions
options[:config_info]
#create_dialogs
can be used both bycreate_catalog_item
andupdate_catalog_item