[parted-devel] [PATCH] add JSON output

Brian C. Lane bcl at redhat.com
Mon Aug 16 22:34:08 BST 2021


On Thu, Aug 12, 2021 at 02:46:48PM +0000, Arvin Schnell wrote:
> 
> Hi,
> 
> here is a patch for master to add JSON as output format using the
> --json command line option. It adds two new values: 1. The max
> number of partitions which is esp. useful for non standard GPTs
> and 2. for MS-DOS the partition type (primary, extended or
> logical) (not available in machine output).

Thanks! I noticed a couple things while trying it out:

 * printing the free space returns number: null
   machine output returned a 1, which also isn't great. I'd suggest 0
   (I do not like json's null type, types should have reasonable
   default values).
 * the model for a file is 'null'
   I think this should be "" as should any other possible string that
   ends up being null.
 * Free space doesn't really say what it is
   We could use number: 0 to indicate that, but that feels like a hack.
   How about we use type: free for free space 'partitions'
 * Needs tests

Looks pretty good other than that,

Brian

-- 
Brian C. Lane (PST8PDT) - weldr.io - lorax - parted - pykickstart




More information about the parted-devel mailing list