Skip to content

Commit

Permalink
Need to only check for existence of dialog_id key to fetch the dialog.
Browse files Browse the repository at this point in the history
  • Loading branch information
h-kataria committed Mar 22, 2017
1 parent 72f9494 commit 6b0d2ae
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions app/controllers/catalog_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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
Expand Down

0 comments on commit 6b0d2ae

Please sign in to comment.