plugins/exclusion: operate on the default list when --name is omitted#3540
Merged
Merged
Conversation
The library treats a NULL list name as the default list (/etc/nvme/exclusions.conf) -- the list nvme disconnect --exclude writes to -- but every mutating exclusion subcommand rejected a missing --name, so the CLI could not manage the most commonly written list at all. Make --name optional on create, delete, add, remove and edit; omitting it targets the default list. Also stop reporting a bad list name as "invalid entry": validate the entry first and attribute a remaining -EINVAL to the name. Add unit tests covering the NULL-name (default list) operations. Signed-off-by: Martin Belanger <martin.belanger@dell.com>
Collaborator
|
This what I was trying to figure out yesterday in the chat, how we handle the defaults. Thanks for making it a nice user experience! |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Bug fix for the
nvme exclusionCLI (merged in #3523). The library treats a NULL list name as the default list (/etc/nvme/exclusions.conf— the onenvme disconnect --excludewrites to), but every mutatingnvme exclusionsubcommand rejected a missing--name, so the CLI could not manage the most commonly written list at all: the only ways to touch it weredisconnect --excludeor a hand edit.--nameis now optional oncreate,delete,add,removeandedit; omitting it targets the default list. The help texts and the five man pages say so, and the synopsis shows the option as optional.Also fixes a misleading error: an invalid list name was reported as
invalid entry (unknown key): <entry>, pointing the user at a perfectly valid entry. The entry is now validated first (invalid entry: …) and a remaining-EINVALis attributed to the name (invalid list name: …).New unit tests cover the NULL-name operations end to end (create/add/match/remove/delete on the default list), alongside the existing exclusion suite. All tests green on glibc and musl.