diff options
author | Christian Breunig <christian@breunig.cc> | 2025-04-28 21:51:07 +0200 |
---|---|---|
committer | Christian Breunig <christian@breunig.cc> | 2025-04-28 22:10:08 +0200 |
commit | a41398d9289457794f3f2e66e1dded7804f3c080 (patch) | |
tree | a276fec6c42f4640e6b591a22ee2de18b93fb598 | |
parent | d4206a0885c080ef2e4b19ff33a30abc8b479dad (diff) | |
download | vyos-1x-a41398d9289457794f3f2e66e1dded7804f3c080.tar.gz vyos-1x-a41398d9289457794f3f2e66e1dded7804f3c080.zip |
T7122: remove trailing chars and add new line for every template.render() call
-rwxr-xr-x | python/vyos/template.py | 2 |
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: |