Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Give a better message from 'zpool get' when an invalid pool name is provided #15942

Merged
merged 1 commit into from
Apr 3, 2024

Conversation

pcd1193182
Copy link
Contributor

Motivation and Context

If you do zpool get name foo, but you have no pool named "foo", the error message you get is very confusing:

$ zpool get name foo
missing pool name.
...

This error message is pretty confusing and misleading, given that a pool name was provided. It just happens to not be the name of an existing pool. We should give a clearer error message.

Description

We give a clearer error message:

$ zpool get name foo
Cannot get properties of foo: no such pool available."

We also no longer print the usage in that case, since it takes up a lot of space and makes it hard to see the error message. The error message itself makes it clear what is expected in that spot.

How Has This Been Tested?

Manual testing.

Types of changes

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Performance enhancement (non-breaking change which improves efficiency)
  • Code cleanup (non-breaking change which makes code smaller or more readable)
  • Breaking change (fix or feature that would cause existing functionality to change)
  • Library ABI change (libzfs, libzfs_core, libnvpair, libuutil and libzfsbootenv)
  • Documentation (a change to man pages or other documentation)

Checklist:

Signed-off-by: Paul Dagnelie <pcd@delphix.com>
@pcd1193182
Copy link
Contributor Author

The failing automated tests seem unrelated to me.

@behlendorf behlendorf added the Status: Accepted Ready to integrate (reviewed, tested) label Apr 3, 2024
@behlendorf behlendorf merged commit b6bbaa8 into openzfs:master Apr 3, 2024
22 of 26 checks passed
tonyhutter pushed a commit that referenced this pull request May 2, 2024
Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov>
Reviewed-by: Don Brady <don.brady@klarasystems.com>
Reviewed-by: Tony Nguyen <tony.nguyen@delphix.com>
Signed-off-by: Paul Dagnelie <pcd@delphix.com>
Closes #15942
lundman pushed a commit to openzfsonwindows/openzfs that referenced this pull request Sep 4, 2024
Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov>
Reviewed-by: Don Brady <don.brady@klarasystems.com>
Reviewed-by: Tony Nguyen <tony.nguyen@delphix.com>
Signed-off-by: Paul Dagnelie <pcd@delphix.com>
Closes openzfs#15942
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Status: Accepted Ready to integrate (reviewed, tested)
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants