summaryrefslogtreecommitdiff
path: root/python
diff options
context:
space:
mode:
Diffstat (limited to 'python')
-rwxr-xr-xpython/vyos/template.py2
1 files changed, 2 insertions, 0 deletions
diff --git a/python/vyos/template.py b/python/vyos/template.py
index d79e1183f..513490963 100755
--- a/python/vyos/template.py
+++ b/python/vyos/template.py
@@ -150,6 +150,8 @@ def render(
# As we are opening the file with 'w', we are performing the rendering before
# calling open() to not accidentally erase the file if rendering fails
rendered = render_to_string(template, content, formater, location)
+ # Remove any trailing character and always add a new line at the end
+ rendered = rendered.rstrip() + "\n"
# Write to file
with open(destination, "w") as file: