mirror of
https://github.com/ansible-collections/community.general.git
synced 2026-04-01 16:23:10 +00:00
pamd: add delete=False to NamedTemporaryFile() (#47281)
* add delete=False to NamedTemporaryFile and remove print statement from module * add changelog fragment
This commit is contained in:
committed by
Sam Doran
parent
c5a9b6acb7
commit
c67ab296bb
@@ -0,0 +1,5 @@
|
||||
---
|
||||
bugfixes:
|
||||
- "pamd: add delete=False to NamedTemporaryFile() fixes OSError on module completion, and
|
||||
removes print statement from module code.
|
||||
(see https://github.com/ansible/ansible/pull/47281 and https://github.com/ansible/ansible/issues/47080)"
|
||||
@@ -776,9 +776,8 @@ def main():
|
||||
# First, create a backup if desired.
|
||||
if module.params['backup']:
|
||||
backupdest = module.backup_local(fname)
|
||||
print("BACKUP DEST", backupdest)
|
||||
try:
|
||||
temp_file = NamedTemporaryFile(mode='w', dir=module.tmpdir)
|
||||
temp_file = NamedTemporaryFile(mode='w', dir=module.tmpdir, delete=False)
|
||||
with open(temp_file.name, 'w') as fd:
|
||||
fd.write(str(service))
|
||||
|
||||
|
||||
Reference in New Issue
Block a user