From 0333f74953e0aca7ab6f6dcf701466024470f88f Mon Sep 17 00:00:00 2001 From: Wido den Hollander Date: Wed, 13 Dec 2017 11:20:53 +0100 Subject: [PATCH] ceph-volume: Try to cast OSD metadata to int while scanning directory By doing so values like 'whoami' and 'bluefs' will be stored as a integer in the resulting JSON rather then a String. Signed-off-by: Wido den Hollander --- src/ceph-volume/ceph_volume/devices/simple/scan.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/ceph-volume/ceph_volume/devices/simple/scan.py b/src/ceph-volume/ceph_volume/devices/simple/scan.py index 905baf41588..b0eb9accc58 100644 --- a/src/ceph-volume/ceph_volume/devices/simple/scan.py +++ b/src/ceph-volume/ceph_volume/devices/simple/scan.py @@ -74,7 +74,11 @@ class Scan(object): if system.is_binary(file_path): continue if os.path.isfile(file_path): - osd_metadata[_file] = self.get_contents(file_path) + content = self.get_contents(file_path) + try: + osd_metadata[_file] = int(content) + except ValueError: + osd_metadata[_file] = content device = path_mounts.get(path) # it is possible to have more than one device, pick the first one, and -- 2.39.5