]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commit
common: str_map: have 'get_str_map' only handling plain-text
authorJoao Eduardo Luis <joao.luis@inktank.com>
Fri, 8 Aug 2014 15:06:04 +0000 (15:06 +0000)
committerJoao Eduardo Luis <joao.luis@inktank.com>
Wed, 27 Aug 2014 17:55:02 +0000 (18:55 +0100)
commit688582494af78765eacec491aca97f4e7ab75ec3
tree3a8bf11b5407e511a4332db48a698ae1799b8354
parentb1af4bd0a1adca1de5e39034f11b0c7138f138e5
common: str_map: have 'get_str_map' only handling plain-text

'get_str_map()' used to handle both JSON and plain-text.  In fact it
would try parsing the map as JSON on a first try and then fallback to
plain-text if it failed.  Altough useful this would pose a big issue
when we attempted to parse some values, tha we knew to be plain-text,
that had some meaning in JSON -- e.g., 'false' or 'true'.  In such case
the JSON parser would spit out an error, stating it had been able to
parse the JSON but didn't expected the type, which in fairness is
acceptable.

In its stead we now have two functions: 'get_str_map()' will only handle
plain-text, whereas 'get_json_str_map()' will keep the previous
behavior, attempting to parse a JSON string and falling back to
'get_str_map()' should it fail.

Signed-off-by: Joao Eduardo Luis <joao.luis@inktank.com>
src/common/str_map.cc
src/include/str_map.h
src/mon/OSDMonitor.cc
src/osd/OSDMap.cc
src/test/common/test_str_map.cc