rgw: fix regionmap json decoding

Signed-off-by: Yehuda Sadeh <yehuda@inktank.com>
This commit is contained in:
Yehuda Sadeh 2013-06-26 22:39:07 -07:00
parent af00f73348
commit 8f1da8f3d4

View File

@ -642,16 +642,9 @@ void RGWRegionMap::dump(Formatter *f) const
encode_json("master_region", master_region, f);
}
static void decode_regions(map<string, RGWRegion>& regions, JSONObj *o)
{
RGWRegion r;
r.decode_json(o);
regions[r.name] = r;
}
void RGWRegionMap::decode_json(JSONObj *obj)
{
JSONDecoder::decode_json("regions", regions, decode_regions, obj);
JSONDecoder::decode_json("regions", regions, obj);
JSONDecoder::decode_json("master_region", master_region, obj);
}