Browse Source

Fix generate_log_config script (#8952)

It used to write an empty file if you gave it a -o arg.
Richard van der Hoff 3 years ago
parent
commit
3ad699cc65
2 changed files with 4 additions and 1 deletions
  1. 1 0
      changelog.d/8952.misc
  2. 3 1
      scripts/generate_log_config

+ 1 - 0
changelog.d/8952.misc

@@ -0,0 +1 @@
+Fix bug in `generate_log_config` script which made it write empty files.

+ 3 - 1
scripts/generate_log_config

@@ -40,4 +40,6 @@ if __name__ == "__main__":
     )
 
     args = parser.parse_args()
-    args.output_file.write(DEFAULT_LOG_CONFIG.substitute(log_file=args.log_file))
+    out = args.output_file
+    out.write(DEFAULT_LOG_CONFIG.substitute(log_file=args.log_file))
+    out.flush()