From 471f5e58d221f38ac9f672666bd078a577bd5799 Mon Sep 17 00:00:00 2001 From: Felix Moessbauer Date: Sun, 30 Apr 2023 09:01:31 +0200 Subject: [PATCH] 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 Signed-off-by: Jan Kiszka --- kas/plugins/dump.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/kas/plugins/dump.py b/kas/plugins/dump.py index 1832b2b..dda8ecc 100644 --- a/kas/plugins/dump.py +++ b/kas/plugins/dump.py @@ -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,