[pve-devel] [PATCH common] properly encode YAML via YAML::XS
Thomas Lamprecht
t.lamprecht at proxmox.com
Thu Sep 17 17:06:56 CEST 2020
On 9/17/20 1:16 PM, Fabian Grünbichler wrote:
> otherwise we get strange errors when formatting data that was originally
> JSON, and can thus contain JSON::true/JSON::false.
>
> one example is the QMP query-blockstats command, which gets called (and
> the resulting values returned) by /nodes/NODE/qemu/VMID/status/current
>
> Signed-off-by: Fabian Grünbichler <f.gruenbichler at proxmox.com>
> ---
>
> Notes:
> alternatives include:
> - dropping --output-format yaml altogether
FWIW: I like yaml, but we do not have it yet in PBS.
It's at least not an option for the 6.x release.
> - manually recursively mapping JSON::true/false to some sensible value before dumping
hmm, could do, not ideal, mostly because we then recurse everything
and the outputter does another time - feels not good.
> - outputting JSON instead of YAML, since the former is a subset of the latter (thanks Dominik ;))
NAK, while technical true I see no point in doing that. yaml is used
over JSON for being more concise and having less syntax noise getting
in ones way when reading it.
Was this issued raised on the currently used module's upstream?
Maybe we/they could fix it there too, helping more than just our use
case.
That said, I have no real objection against using this XS binding of
libyaml-0-2.
btw. we get that already installed on ceph setups through the dependency
chain: ceph-mgr -> python3-yaml -> libyaml-0-2
More information about the pve-devel
mailing list