1
0
Fork 0
mirror of https://github.com/ansible-collections/community.general.git synced 2024-09-14 20:13:21 +02:00

Create temp file in directory where ssh key lives

This commit is contained in:
Stephen Fromm 2012-10-24 20:50:11 -07:00
parent b2e94e53fc
commit 544dc76704

View file

@ -118,7 +118,7 @@ def readkeys(filename):
def writekeys(module, filename, keys): def writekeys(module, filename, keys):
fd, tmp_path = tempfile.mkstemp() fd, tmp_path = tempfile.mkstemp('', 'tmp', os.path.dirname(filename))
f = open(tmp_path,"w") f = open(tmp_path,"w")
try: try:
f.writelines( (key + "\n" for key in keys) ) f.writelines( (key + "\n" for key in keys) )