| Hi all, I am working on a PR on this, and I have some questions regarding it. If I understand correctly, in a .pp file, Float["infinity"], Float["-infinity"], and Float["NaN"] should match their corresponding float values(Ruby types Float::INFINITY, Float::Infinity and Float::NaN). My problems start when I treat a custom fact that returns 1.0/0.0 as Float::INFINITY and as string "Infinity". After some debugging, if the fact is treated as Float::INFINITY, the JSON becomes { "my_custom_fact" : Infinity } which is not a valid JSON, but MultiJson can parse such a json with :allow_nan flag set to true, but I think this will require changes everywhere the standard Json library fails. The classifier on the master node fails as it also needs to parse invalid JSON and I assume Content-Type' => 'application/json' POST requests will also fail. If facts that return Float::Infinity are turned into string "Infinite", then in a .pp file a simple if $::maxwaitforcert > 100 comparison will fail because of incompatible types. Treating every "Infinity" string in a .pp like a Float::Infinity seems like it could also have many holes. I also tried to treat a fact that returns Float::Infinite like Float::MAX and this seems to cause no problems but it may be inconsistent depending on the platform, and reported fact returns something like 1.7976931348623157e+308. I may be missing something, but can't find good way to treat this type of facts. Anyone got any ideas on what to try next? |