From: Yehuda Sadeh Date: Wed, 19 Dec 2018 11:15:30 +0000 (-0800) Subject: ceph_json: parser sets data on all types when parsing X-Git-Tag: v14.1.0~563^2~1 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=d3e2d9bf06a0129526fa9041765f49712448400b;p=ceph.git 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 --- 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)); }