From 957cd57ea9bd28539ede3c823af96634be14ecb3 Mon Sep 17 00:00:00 2001 From: Paul Belanger Date: Thu, 31 Aug 2017 16:54:02 -0400 Subject: [PATCH] Fix syntax issue with NamedTemporaryFile We need to use filter_file.name to get the actually path. Change-Id: I130284fdaccd1ace139d71b8a3395e9e9fa0df76 Signed-off-by: Paul Belanger --- roles/upload-afs/library/zuul_afs.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/roles/upload-afs/library/zuul_afs.py b/roles/upload-afs/library/zuul_afs.py index 10b751dbd..a4ac8edb1 100644 --- a/roles/upload-afs/library/zuul_afs.py +++ b/roles/upload-afs/library/zuul_afs.py @@ -85,11 +85,11 @@ def afs_sync(afssource, afstarget): shell_cmd = bash_cmd.format( src=subsource, dst=subtarget, - filter=filter_file) + filter=filter_file.name) output['source'] = subsource output['destination'] = subtarget output['output'] = subprocess.check_output(shell_cmd, shell=True) - os.remove(filter_file) + os.remove(filter_file.name) return output_blocks