From 392603a881957f6e8cf03c29610e8878c53cff33 Mon Sep 17 00:00:00 2001 From: Wido den Hollander Date: Tue, 12 Dec 2017 21:27:07 +0100 Subject: [PATCH] ceph-volume: Add linesep/newline at end of JSON file when writing Instead of: "systemd": "", "type": "bluestore", "whoami": "0" }root@alpha:~# A newline is added to the JSON file when writing: "type": "bluestore", "whoami": "0" } root@alpha:~# Makes it a bit easier to read the JSON files on a terminal Signed-off-by: Wido den Hollander --- src/ceph-volume/ceph_volume/devices/simple/scan.py | 1 + 1 file changed, 1 insertion(+) diff --git a/src/ceph-volume/ceph_volume/devices/simple/scan.py b/src/ceph-volume/ceph_volume/devices/simple/scan.py index 905baf41588..80fec8a125c 100644 --- a/src/ceph-volume/ceph_volume/devices/simple/scan.py +++ b/src/ceph-volume/ceph_volume/devices/simple/scan.py @@ -129,6 +129,7 @@ class Scan(object): else: with open(json_path, 'w') as fp: json.dump(osd_metadata, fp, indent=4, sort_keys=True, ensure_ascii=False) + fp.write(os.linesep) terminal.success( 'OSD %s got scanned and metadata persisted to file: %s' % ( osd_id, -- 2.47.3