Skip to content

Commit c355cdb

Browse files
committed
Added test case for b64 + jinja
1 parent 53cfbd4 commit c355cdb

File tree

4 files changed

+548
-505
lines changed

4 files changed

+548
-505
lines changed

ecs_files_composer/files_mgmt.py

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -173,6 +173,7 @@ def render_jinja(self):
173173
Allows to use the temp directory as environment base, the original file as source template, and render
174174
a final template.
175175
"""
176+
LOG.info(f"Rendering Jinja for {self.path} - {self.templates_dir.name}")
176177
jinja_env = Environment(
177178
loader=FileSystemLoader(self.templates_dir.name),
178179
autoescape=True,
@@ -237,8 +238,9 @@ def write_content(
237238
LOG.info(f"Outputting {self.path} to {file_path}")
238239
if isinstance(self.content, str):
239240
if decode and self.encoding == Encoding["base64"]:
240-
with open(file_path, "wb") as file_fd:
241-
file_fd.write(base64.b64decode(self.content))
241+
LOG.debug(f"Outputting B64 to {file_path}")
242+
with open(file_path, "w") as file_fd:
243+
file_fd.write(base64.b64decode(self.content).decode())
242244
else:
243245
with open(file_path, "w") as file_fd:
244246
file_fd.write(self.content)

0 commit comments

Comments
 (0)