mirror of
https://github.com/ansible-collections/community.general.git
synced 2026-05-05 01:43:05 +00:00
[PR #11954/89e0d070 backport][stable-12] puppet: fix TypeError when writing facts data (#11969)
puppet: fix `TypeError` when writing facts data (#11954)
* fix(puppet): remove erroneous encode() call in _write_structured_data()
Fixes #7932
* changelog: add fragment for puppet facts TypeError fix (#11954)
(cherry picked from commit 89e0d07071)
Co-authored-by: Alexei Znamensky <103110+russoz@users.noreply.github.com>
This commit is contained in:
parent
c2129d331b
commit
b6e41311fd
2 changed files with 3 additions and 1 deletions
|
|
@ -204,7 +204,7 @@ def _write_structured_data(basedir, basename, data):
|
|||
# open the file with only u+rw set. Also, we use the stat constants
|
||||
# because ansible still supports python 2.4 and the octal syntax changed
|
||||
out_file = os.fdopen(os.open(file_path, os.O_CREAT | os.O_WRONLY, stat.S_IRUSR | stat.S_IWUSR), "w")
|
||||
out_file.write(json.dumps(data).encode("utf8"))
|
||||
out_file.write(json.dumps(data))
|
||||
out_file.close()
|
||||
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue