]> git.apps.os.sepia.ceph.com Git - ceph-ci.git/commitdiff
ceph-volume: Add linesep/newline at end of JSON file when writing
authorWido den Hollander <wido@42on.com>
Tue, 12 Dec 2017 20:27:07 +0000 (21:27 +0100)
committerWido den Hollander <wido@42on.com>
Tue, 12 Dec 2017 20:27:07 +0000 (21:27 +0100)
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 <wido@42on.com>
src/ceph-volume/ceph_volume/devices/simple/scan.py

index 905baf415889c06c0490d1fdd74c0f64f02416d0..80fec8a125ca8c6e21fd3da639596a2bd2f8af89 100644 (file)
@@ -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,