From d3e2d9bf06a0129526fa9041765f49712448400b Mon Sep 17 00:00:00 2001 From: Yehuda Sadeh Date: Wed, 19 Dec 2018 03:15:30 -0800 Subject: [PATCH] ceph_json: parser sets data on all types when parsing Fixes: http://tracker.ceph.com/issues/37706 This was changed in e47a228a868, but breaks existing usage. Signed-off-by: Yehuda Sadeh --- src/common/ceph_json.cc | 11 ++++------- 1 file changed, 4 insertions(+), 7 deletions(-) diff --git a/src/common/ceph_json.cc b/src/common/ceph_json.cc index cc12a620211..c1b77c0ebce 100644 --- a/src/common/ceph_json.cc +++ b/src/common/ceph_json.cc @@ -170,13 +170,10 @@ void JSONObj::init(JSONObj *p, Value v, string n) data = v; handle_value(v); - if (v.type() != obj_type && - v.type() != array_type) { - if (v.type() == str_type) { - val.set(v.get_str(), true); - } else { - val.set(json_spirit::write_string(v), false); - } + if (v.type() == str_type) { + val.set(v.get_str(), true); + } else { + val.set(json_spirit::write_string(v), false); } attr_map.insert(pair(name, val)); } -- 2.39.5