Fedora Account System
Red Hat Associate
Red Hat Customer
Description of problem: Ansible playbook service cannot be retired if "Remove resources?" field has "Yes" value. Version-Release number of selected component (if applicable): 5.8.0.12-rc1.20170425180304_4f35996 How reproducible: Always Steps to Reproduce: 1. Enable Embedded Ansible role. 2. Wait until it will be enabled. 3. Navigate to Automation/Ansible. 4. Add some credential and repository with ansible playbook. 5. Navigate to Services/Catalogs/Catalog Items. 6. Open ansible catalog item creation dialog. 7. Fill Provision tab. 8. In Retirement tab leave "Remove Resource?" field value as "Yes". 9. Provision a service from the catalog item. 10. Perform service retirement. Actual results: The service is not retired. There is an error in the log. Expected results: The service should be retired. Additional info: [----] E, [2017-04-28T02:33:29.654531 #3768:5c5f558] ERROR -- : <AutomationEngine> The following error occurred during instance method <retire_service_resources> for AR object <#<ServiceAnsiblePlaybook id: 15, name: "Test11", description: "test11", guid: "55c3578a-2bdc-11e7-a792-001a4a4475ba", type: "ServiceAnsiblePlaybook", service_template_id: 13, options: {:config_info=>{:provision=>{:repository_id=>1, :playbook_i d=>3, :credential_id=>6, :hosts=>"localhost", :extra_vars=>{}, :dialog_id=>2, :fqname=>"/Service/Generic/StateMachines/GenericLifecycle/provision"}, :retirement=>{:remove_resources=>"yes_without_playbook", :hos ts=>"localhost", :extra_vars=>{}, :repository_id=>1, :playbook_id=>2, :credential_id=>6, :fqname=>"/Service/Generic/StateMachines/GenericLifecycle/Retire_Basic_Resource"}}, :dialog=>{"dialog_credential"=>"6", " dialog_hosts"=>"localhost"}, :provision_job_options=>{"hosts"=>"localhost", "extra_vars"=>{}, "credential"=>"2"}}, display: true, created_at: "2017-04-28 06:31:38", updated_at: "2017-04-28 06:33:27", evm_owner_ id: 1, miq_group_id: 2, retired: false, retires_on: nil, retirement_warn: nil, retirement_last_warn: nil, retirement_state: "retiring", retirement_requester: "admin", tenant_id: 1, ancestry: nil, initiator: "us er">> [----] E, [2017-04-28T02:33:29.654725 #3768:5c5f558] ERROR -- : <AutomationEngine> MiqAeServiceModelBase.ar_method raised: <ActiveRecord::RecordNotFound>: <Couldn't find NotificationType> [----] E, [2017-04-28T02:33:29.654806 #3768:5c5f558] ERROR -- : <AutomationEngine> /opt/rh/cfme-gemset/gems/activerecord-5.0.2/lib/active_record/core.rb:212:in `find_by!' /var/www/miq/vmdb/app/models/notification.rb:18:in `type=' /opt/rh/cfme-gemset/gems/activemodel-5.0.2/lib/active_model/attribute_assignment.rb:46:in `public_send' /opt/rh/cfme-gemset/gems/activemodel-5.0.2/lib/active_model/attribute_assignment.rb:46:in `_assign_attribute' /opt/rh/cfme-gemset/gems/activemodel-5.0.2/lib/active_model/attribute_assignment.rb:40:in `block in _assign_attributes' /opt/rh/cfme-gemset/gems/activemodel-5.0.2/lib/active_model/attribute_assignment.rb:39:in `each' /opt/rh/cfme-gemset/gems/activemodel-5.0.2/lib/active_model/attribute_assignment.rb:39:in `_assign_attributes' /opt/rh/cfme-gemset/gems/activerecord-5.0.2/lib/active_record/attribute_assignment.rb:26:in `_assign_attributes' /opt/rh/cfme-gemset/gems/activemodel-5.0.2/lib/active_model/attribute_assignment.rb:33:in `assign_attributes' /opt/rh/cfme-gemset/gems/activerecord-5.0.2/lib/active_record/core.rb:319:in `initialize' /opt/rh/cfme-gemset/gems/default_value_for-3.0.2/lib/default_value_for.rb:142:in `initialize' /opt/rh/cfme-gemset/gems/activerecord-5.0.2/lib/active_record/inheritance.rb:65:in `new' /opt/rh/cfme-gemset/gems/activerecord-5.0.2/lib/active_record/inheritance.rb:65:in `new' /opt/rh/cfme-gemset/gems/activerecord-5.0.2/lib/active_record/persistence.rb:33:in `create' /var/www/miq/vmdb/app/models/mixins/retirement_mixin.rb:140:in `finish_retirement' /var/www/miq/vmdb/app/models/manageiq/providers/embedded_ansible/automation_manager/job.rb:8:in `retire_now' /var/www/miq/vmdb/app/models/service/retirement_management.rb:22:in `block in retire_service_resources' /opt/rh/cfme-gemset/gems/activerecord-5.0.2/lib/active_record/relation/delegation.rb:38:in `each' /opt/rh/cfme-gemset/gems/activerecord-5.0.2/lib/active_record/relation/delegation.rb:38:in `each' /var/www/miq/vmdb/app/models/service/retirement_management.rb:19:in `retire_service_resources' /var/www/miq/vmdb/lib/miq_automation_engine/engine/miq_ae_method_service/miq_ae_service_model_base.rb:266:in `public_send' /var/www/miq/vmdb/lib/miq_automation_engine/engine/miq_ae_method_service/miq_ae_service_model_base.rb:266:in `block in object_send' /var/www/miq/vmdb/lib/miq_automation_engine/engine/miq_ae_method_service/miq_ae_service_model_base.rb:285:in `ar_method' /var/www/miq/vmdb/lib/miq_automation_engine/engine/miq_ae_method_service/miq_ae_service_model_base.rb:295:in `ar_method' /var/www/miq/vmdb/lib/miq_automation_engine/engine/miq_ae_method_service/miq_ae_service_model_base.rb:264:in `object_send' /var/www/miq/vmdb/lib/miq_automation_engine/engine/miq_ae_method_service/miq_ae_service_model_base.rb:119:in `block (2 levels) in expose' /opt/rh/rh-ruby23/root/usr/share/ruby/drb/drb.rb:1624:in `perform_without_block' /opt/rh/rh-ruby23/root/usr/share/ruby/drb/drb.rb:1584:in `perform' /opt/rh/rh-ruby23/root/usr/share/ruby/drb/drb.rb:1657:in `block (2 levels) in main_loop' /opt/rh/rh-ruby23/root/usr/share/ruby/drb/drb.rb:1653:in `loop' /opt/rh/rh-ruby23/root/usr/share/ruby/drb/drb.rb:1653:in `block in main_loop'
Hi Dmitry, Can I access your environment? Thanks, Tina
https://github.com/ManageIQ/manageiq/pull/14955
https://github.com/ManageIQ/manageiq/pull/14957
https://github.com/ManageIQ/manageiq-content/pull/106
New commit detected on ManageIQ/manageiq/master: https://github.com/ManageIQ/manageiq/commit/93af270bb0de182d2636ae900d0add487d2f95f0 commit 93af270bb0de182d2636ae900d0add487d2f95f0 Author: Tina Fitzgerald <tfitzger> AuthorDate: Mon May 1 15:58:55 2017 -0400 Commit: Tina Fitzgerald <tfitzger> CommitDate: Mon May 1 16:11:07 2017 -0400 Reverting previous changes to add notification to finish retirement. Since not all objects have user/tenant information, we're going to create a content PR to add notifications to Automate methods where that information is available. https://bugzilla.redhat.com/show_bug.cgi?id=1446466 app/models/mixins/retirement_mixin.rb | 1 - spec/models/orchestration_stack/retirement_management_spec.rb | 1 - spec/models/service/retirement_management_spec.rb | 1 - spec/models/vm/retirement_management_spec.rb | 1 - 4 files changed, 4 deletions(-)
New commit detected on ManageIQ/manageiq/master: https://github.com/ManageIQ/manageiq/commit/54fedf71ecdda6e624016477f93673dc38f93f72 commit 54fedf71ecdda6e624016477f93673dc38f93f72 Author: Tina Fitzgerald <tfitzger> AuthorDate: Mon May 1 16:17:08 2017 -0400 Commit: Tina Fitzgerald <tfitzger> CommitDate: Mon May 1 16:17:08 2017 -0400 Add orchestration_stack_retired. https://bugzilla.redhat.com/show_bug.cgi?id=1446466 db/fixtures/notification_types.yml | 6 ++++++ 1 file changed, 6 insertions(+)
https://github.com/ManageIQ/manageiq/pull/14963
New commit detected on ManageIQ/manageiq/fine: https://github.com/ManageIQ/manageiq/commit/cd03ffd04ff291034e4e364ba9d85a21e8e8ab5d commit cd03ffd04ff291034e4e364ba9d85a21e8e8ab5d Author: Tina Fitzgerald <tfitzger> AuthorDate: Tue May 2 11:13:45 2017 -0400 Commit: Tina Fitzgerald <tfitzger> CommitDate: Tue May 2 11:13:45 2017 -0400 Removed notification check from finish_retirement tests. https://bugzilla.redhat.com/show_bug.cgi?id=1446466 .../miq_automation_engine/service_models/miq_ae_service_service_spec.rb | 1 - spec/lib/miq_automation_engine/service_models/miq_ae_service_vm_spec.rb | 1 - 2 files changed, 2 deletions(-)
https://github.com/ManageIQ/manageiq-automation_engine/pull/6
New commit detected on ManageIQ/manageiq-automation_engine/master: https://github.com/ManageIQ/manageiq-automation_engine/commit/321298dce0bcce99988811e8b66518a02f03533d commit 321298dce0bcce99988811e8b66518a02f03533d Author: Tina Fitzgerald <tfitzger> AuthorDate: Tue May 2 11:39:05 2017 -0400 Commit: Tina Fitzgerald <tfitzger> CommitDate: Tue May 2 11:39:05 2017 -0400 Remove notification check from finish_retirement tests. https://bugzilla.redhat.com/show_bug.cgi?id=1446466 spec/service_models/miq_ae_service_service_spec.rb | 1 - spec/service_models/miq_ae_service_vm_spec.rb | 1 - 2 files changed, 2 deletions(-)
New commit detected on ManageIQ/manageiq-content/master: https://github.com/ManageIQ/manageiq-content/commit/de8a759831aa46d30a81640ac43d67797ff631b4 commit de8a759831aa46d30a81640ac43d67797ff631b4 Author: Tina Fitzgerald <tfitzger> AuthorDate: Mon May 1 17:54:29 2017 -0400 Commit: Tina Fitzgerald <tfitzger> CommitDate: Tue May 2 13:37:52 2017 -0400 Add notifications for finish_retirement. https://bugzilla.redhat.com/show_bug.cgi?id=1446466 .../StateMachines/Methods.class/__methods__/finish_retirement.rb | 1 + .../StateMachines/Methods.class/__methods__/finish_retirement.rb | 1 + .../StateMachines/Methods.class/__methods__/finish_retirement.rb | 1 + .../StateMachines/Methods.class/__methods__/finish_retirement.rb | 1 + .../StateMachines/Methods.class/__methods__/finish_retirement_spec.rb | 1 + 5 files changed, 5 insertions(+)
Verified in 5.9.0.1.20171004215954_13427ce. A service successfully retired.