From 6b0d2ae6794cb801723251453b57789f70255f8e Mon Sep 17 00:00:00 2001 From: Harpreet Kataria Date: Wed, 22 Mar 2017 17:03:49 -0400 Subject: [PATCH] Need to only check for existence of dialog_id key to fetch the dialog. --- app/controllers/catalog_controller.rb | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/app/controllers/catalog_controller.rb b/app/controllers/catalog_controller.rb index b83a3bb69af1..13eb47a0b1b7 100644 --- a/app/controllers/catalog_controller.rb +++ b/app/controllers/catalog_controller.rb @@ -1783,8 +1783,8 @@ def fetch_playbook_details playbook_details[:provisioning][:machine_credential] = ManageIQ::Providers::EmbeddedAnsible::AutomationManager::MachineCredential.find_by(:id => provision[:credential_id]).name playbook_details[:provisioning][:network_credential] = ManageIQ::Providers::EmbeddedAnsible::AutomationManager::NetworkCredential.find_by(:id => provision[:network_credential_id]).name if provision[:network_credential_id] playbook_details[:provisioning][:cloud_credential] = ManageIQ::Providers::EmbeddedAnsible::AutomationManager::CloudCredential.find_by(:id => provision[:cloud_credential_id]).name if provision[:cloud_credential_id] - dialog = provision[:dialog_id] ? Dialog.find_by(:id => provision[:dialog_id]) : Dialog.find_by(:name => provision[:dialog_name]) - if dialog + if provision[:dialog_id] + dialog = Dialog.find_by(:id => provision[:dialog_id]) playbook_details[:provisioning][:dialog] = dialog.name playbook_details[:provisioning][:dialog_id] = dialog.id end @@ -1799,8 +1799,8 @@ def fetch_playbook_details playbook_details[:retirement][:machine_credential] = ManageIQ::Providers::EmbeddedAnsible::AutomationManager::MachineCredential.find_by(:id => retirement[:credential_id]).name playbook_details[:retirement][:network_credential] = ManageIQ::Providers::EmbeddedAnsible::AutomationManager::NetworkCredential.find_by(:id => retirement[:network_credential_id]).name if retirement[:network_credential_id] playbook_details[:retirement][:cloud_credential] = ManageIQ::Providers::EmbeddedAnsible::AutomationManager::CloudCredential.find_by(:id => retirement[:cloud_credential_id]).name if retirement[:cloud_credential_id] - dialog = provision[:dialog_id] ? Dialog.find_by(:id => retirement[:dialog_id]) : Dialog.find_by(:name => retirement[:dialog_name]) - if dialog + if retirement[:dialog_id] + dialog = Dialog.find_by(:id => retirement[:dialog_id]) playbook_details[:retirement][:dialog] = dialog.name playbook_details[:retirement][:dialog_id] = dialog.id end