Skip to content

Commit

Permalink
Use standard method for filesystem cleanup
Browse files Browse the repository at this point in the history
Use standard method for filesystem cleanup, it fetches and memoizes
the data, before it deletes the files holding the data.
  • Loading branch information
Ladas committed Jul 30, 2018
1 parent 12b109c commit 4bc3609
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions lib/ansible/runner.rb
Original file line number Diff line number Diff line change
Expand Up @@ -145,11 +145,11 @@ def run_via_cli(env_vars, extra_vars, playbook_path: nil, role_name: nil, roles_
:roles_path => roles_path,
:role_skip_facts => role_skip_facts))

response(base_dir, ansible_runner_method, result)
res = response(base_dir, ansible_runner_method, result)
ensure
# Clean up the tmp dir for the sync method, for async we will clean it up after the job is finished and we've
# read the output, that will be written into this directory.
FileUtils.remove_entry(base_dir) unless async?(ansible_runner_method)
res.cleanup_filesystem! unless async?(ansible_runner_method)
end
end

Expand Down

0 comments on commit 4bc3609

Please sign in to comment.