Permalink
Browse files

Clean code, fd.close not required since open as fd if used; remove ge…

…t_redirected_output from cleanup_redirection_tempfiles since output is not used

(cherry picked from commit ef51f00bbc9f24485915040b863c9d034d3c272c)
  • Loading branch information...
dj4ngo authored and abadger committed Sep 21, 2017
1 parent f66c749 commit 901bc2cffef231194a5710bb068c7218590c5a91
Showing with 2 additions and 3 deletions.
  1. +2 −3 lib/ansible/modules/cloud/docker/docker_service.py
@@ -511,8 +511,8 @@ def make_redirection_tempfiles():
def cleanup_redirection_tempfiles(out_name, err_name):
get_redirected_output(out_name)
get_redirected_output(err_name)
for i in [out_name, err_name]:
os.remove(i)
def get_redirected_output(path_name):
@@ -522,7 +522,6 @@ def get_redirected_output(path_name):
# strip terminal format/color chars
new_line = re.sub(r'\x1b\[.+m', '', line)
output.append(new_line)
fd.close()
os.remove(path_name)
return output

0 comments on commit 901bc2c

Please sign in to comment.