dump plugin: add newline to file in inplace mode

The auto-generated lockfiles should be terminated with a newline to be
POSIX compliant. Previously, this only worked for output via stdout but
not for inplace operations. This is fixed by appending the newline to
the active output target.

Signed-off-by: Felix Moessbauer <felix.moessbauer@siemens.com>
Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com>
This commit is contained in:
Felix Moessbauer 2023-04-30 09:01:31 +02:00 committed by Jan Kiszka
parent e2bf6d74df
commit 471f5e58d2

View File

@ -208,7 +208,7 @@ class Dump(Checkout):
with IoTargetMonitor(output) as f:
if args.format == 'json':
json.dump(config_expanded, f, indent=args.indent)
sys.stdout.write('\n')
f.write('\n')
elif args.format == 'yaml':
yaml.dump(
config_expanded, f,