Skip to content

facts.zfs: request parsable, exact, numbers#1501

Closed
Pirols wants to merge 1 commit intopyinfra-dev:3.xfrom
Pirols:zfs_facts_parsable_output
Closed

facts.zfs: request parsable, exact, numbers#1501
Pirols wants to merge 1 commit intopyinfra-dev:3.xfrom
Pirols:zfs_facts_parsable_output

Conversation

@Pirols
Copy link
Copy Markdown
Contributor

@Pirols Pirols commented Nov 18, 2025

Both zfs get and zpool get have a -p option to request parsable (exact) output.

dpool   size    266287972352    -
dpool   size    248G    -
  • Pull request is based on the default branch (3.x at this time)
  • Pull request includes tests for any new/updated operations/facts
  • Pull request includes documentation for any new/updated operations/facts
  • Tests pass (see scripts/dev-test.sh)
  • Type checking & code style passes (see scripts/dev-lint.sh)

Both `zfs get` and `zpool get` have a `-p` option to request parsable (exact)
output.

```
dpool   size    266287972352    -
dpool   size    248G    -
```
Copy link
Copy Markdown
Member

@Fizzadar Fizzadar left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Small issue because the tests aren't updated to the new output format. Once fixed this means it's (annoyingly) a breaking change to the fact. One option is we could parse the exact (byte, I assume?) value and call it size_bytes and then we can generate size as a human friendly string from the bytes to maintain backwards compatibility. How does that sound?

requires_command: zfs
output: |
tank type filesystem -
tank size 2.71T -
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Test isn't updated to match the change (same w/ others).

@Fizzadar
Copy link
Copy Markdown
Member

Closing as stale

@Fizzadar Fizzadar closed this Apr 20, 2026
@Pirols
Copy link
Copy Markdown
Contributor Author

Pirols commented Apr 21, 2026

Closing as stale

Yes, sorry. Did not have time for this. Perhaps I will re-open at some point.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants