container_puppet_config: python3 fix

Python3 returns an error if we write the file in text. We need to write
in binary.

Closes-Bug: #1863352
Change-Id: Ief80c917803c2143e459a74079159d958d18f153
This commit is contained in:
Emilien Macchi 2020-02-14 12:17:18 -05:00
parent 6cfc382961
commit 05a9daa46f
1 changed files with 1 additions and 1 deletions

View File

@ -412,7 +412,7 @@ class ContainerPuppetManager:
:param path: string
:param config: string
"""
f = open(path, 'w')
f = open(path, 'wb')
f.write(json.dumps(config, indent=2).encode('utf-8'))
os.chmod(path, 0o600)