Skip to content

Commit

Permalink
Removing temporary files when not proxing inside urls utils (ansible#…
Browse files Browse the repository at this point in the history
  • Loading branch information
acrewdson authored and samdoran committed Feb 1, 2018
1 parent 684e953 commit fe06704
Showing 1 changed file with 14 additions and 0 deletions.
14 changes: 14 additions & 0 deletions lib/ansible/module_utils/urls.py
Original file line number Diff line number Diff line change
Expand Up @@ -618,6 +618,10 @@ def get_ca_certs(self):
pass

if not to_add:
try:
os.remove(to_add_path)
except OSError:
pass
to_add_path = None
return (tmp_path, to_add_path, paths_checked)

Expand Down Expand Up @@ -677,6 +681,16 @@ def http_request(self, req):

if not use_proxy:
# ignore proxy settings for this host request
if tmp_ca_cert_path:
try:
os.remove(tmp_ca_cert_path)
except OSError:
pass
if to_add_ca_cert_path:
try:
os.remove(to_add_ca_cert_path)
except OSError:
pass
return req

try:
Expand Down

0 comments on commit fe06704

Please sign in to comment.