Skip to content

Commit

Permalink
Fix rubocop
Browse files Browse the repository at this point in the history
  • Loading branch information
fabiendupont committed Apr 15, 2019
1 parent ec54ccc commit 3d6e5ff
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions app/models/conversion_host.rb
Original file line number Diff line number Diff line change
Expand Up @@ -317,11 +317,10 @@ def ansible_playbook(playbook, extra_vars = {}, update_task = true, auth_type =
rescue => e
errormsg = "Ansible playbook '#{playbook}' failed for '#{resource.name}' with [#{e.class}: #{e}]"
_log.error(errormsg)
task.error(errormsg) unless task.nil?
task&.error(errormsg)
raise e
ensure
context = task.context_data
task.update_context(task.context_data.merge!(:ansible_output => result.output)) unless task.nil? || result.nil?
task&.update_context(task.context_data.merge!(:ansible_output => result.output)) unless result.nil?
File.delete(runner_password_file) if !runner_password_file.nil? && File.exist?(runner_password_file)
File.delete(runner_ssh_key_file) if !runner_ssh_key_file.nil? && File.exist?(runner_ssh_key_file)
end
Expand Down

0 comments on commit 3d6e5ff

Please sign in to comment.