From: Wido den Hollander Date: Tue, 12 Dec 2017 20:27:07 +0000 (+0100) Subject: ceph-volume: Add linesep/newline at end of JSON file when writing X-Git-Tag: v13.0.2~756^2 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=refs%2Fpull%2F19458%2Fhead;p=ceph.git 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 --- diff --git a/src/ceph-volume/ceph_volume/devices/simple/scan.py b/src/ceph-volume/ceph_volume/devices/simple/scan.py index 905baf415889..80fec8a125ca 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,