Bug #40294
openlibrados mon_command json parser int/float type problem
0%
Description
for some commands there is a parameterof type float,
e.g. for 'osd reweight' there is the parameter 'weight' of type float (with a range of 0.0 to 1.0)
when giving such command as json to rados_mon_command
e.g.
{ "prefix":"osd reweight", "id":0, "weight":0.0 }
it works, but
{ "prefix":"osd reweight", "id":0, "weight": 0 }
does not
this is a problem, since json does not define different types of numbers, so 0.0 and 0 should be treated the same
and some json encoders will convert 0.0 to 0 (e.g. in Perl using JSON::encode_json)
Files
Updated by Greg Farnum almost 5 years ago
What's the failure mode? What version are you running against?
Updated by Dominik Csapak almost 5 years ago
Greg Farnum wrote:
What's the failure mode? What version are you running against?
ceph version is 14.2.1
i am not sure what you mean with failure modes, but i have attached a small sample program to
make it clear what we do
that program prints:
cmd successfully exectued mon_command error: Invalid argument status: bad or missing field 'weight'