Skip to content

Commit b59da03

Browse files
link2xtFizzadar
authored andcommitted
Do not reuse temporary file in server.script()
Even if `src` is the same, other parameters such as `_su_user` may be different. In this case pyinfra unconditionally tries to run `chmod +x` on the file and fails, because the file is already uploaded as a different user.
1 parent 277cb6f commit b59da03

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

pyinfra/operations/server.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -172,7 +172,7 @@ def script(src):
172172
)
173173
"""
174174

175-
temp_file = state.get_temp_filename(src)
175+
temp_file = state.get_temp_filename()
176176
yield from files.put(src, temp_file)
177177

178178
yield chmod(temp_file, "+x")

0 commit comments

Comments
 (0)