Closed lukebakare closed 2 months ago
@lukebakare it does work, depending on the command:
[ec2-user] $ sudo pvs
PV VG Fmt Attr PSize PFree
/dev/sdb lvm2 --- 8.00g 8.00g
[ec2-user] $ sudo pvs --reportformat json
{
"report": [
{
"pv": [
{"pv_name":"/dev/sdb", "vg_name":"", "pv_fmt":"lvm2", "pv_attr":"---", "pv_size":"8.00g", "pv_free":"8.00g"}
]
}
]
}
[ec2-user] $
Notice that pvdisplay
doesn't have that option:
pvdisplay
[ -a|--all ]
[ -c|--colon ]
[ -C|--columns ]
[ -m|--maps ]
[ -o|--options String ]
[ -S|--select String ]
[ -s|--short ]
[ -O|--sort String ]
[ --aligned ]
[ --binary ]
[ --configreport log|vg|lv|pv|pvseg|seg ]
[ --foreign ]
[ --ignorelockingfailure ]
[ --logonly ]
[ --noheadings ]
[ --nosuffix ]
[ --readonly ]
[ --separator String ]
[ --shared ]
[ --unbuffered ]
[ --units [Number]r|R|h|H|b|B|s|S|k|K|m|M|g|G|t|T|p|P|e|E ]
[ COMMON_OPTIONS ]
[ PV|Tag ... ]
Okay thanks.
Running pvdisplay does seem to recognise it as an option though:
[root@ip-172-31-31-74 ~]# pvdisplay --reportformat pvdisplay: option '--reportformat' requires an argument Error during parsing of command line.
Describe the bug Adding the --reportformat json flag to lvm doesn't work.
To Reproduce Steps to reproduce the behavior: Run pvdisplay --reportformat json vgdisplay --reportformat json lsdisplay --reportformat json It outputs text in basic mode instead of json.
Expected behavior The command should provide json output.