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

fixed python 2.4 compatibility

nf=tempfile.NamedTemporaryFile(delete=False)
TypeError: NamedTemporaryFile() got an unexpected keyword argument 'delete'
This commit is contained in:
colynn.liu 2016-01-22 18:05:48 +08:00 committed by Matt Clay
parent ccee183143
commit ed48fb0f25

View file

@ -225,11 +225,16 @@ def main():
nf.write(new_limit)
f.close()
nf.close()
nf.flush()
# Copy tempfile to newfile
module.atomic_move(nf.name, f.name)
try:
nf.close()
except:
pass
res_args = dict(
changed = changed, msg = message
)