From a4ed443dc8903198eea5458b1fa3085025891d8b Mon Sep 17 00:00:00 2001 From: Marcel Hild Date: Tue, 29 Aug 2017 10:05:47 +0200 Subject: [PATCH] check if project_id is accessible https://bugzilla.redhat.com/show_bug.cgi?id=1485414 --- .../shared/inventory/parser/automation_manager.rb | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/app/models/manageiq/providers/ansible_tower/shared/inventory/parser/automation_manager.rb b/app/models/manageiq/providers/ansible_tower/shared/inventory/parser/automation_manager.rb index c2d9ca78..3644e74a 100644 --- a/app/models/manageiq/providers/ansible_tower/shared/inventory/parser/automation_manager.rb +++ b/app/models/manageiq/providers/ansible_tower/shared/inventory/parser/automation_manager.rb @@ -33,7 +33,9 @@ def configuration_scripts inventory_object.variables = job_template.extra_vars_hash inventory_object.inventory_root_group = persister.inventory_root_groups.lazy_find(job_template.inventory_id.to_s) inventory_object.parent = persister.configuration_script_payloads.lazy_find( - :configuration_script_source => job_template.project_id, + # checking job_template.project_id due to https://github.com/ansible/ansible_tower_client_ruby/issues/68 + # if we hit a job_template which has no related project and thus .project_id is not defined + :configuration_script_source => job_template.try(:project_id), :manager_ref => job_template.playbook )