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

CLI: Fix verdi config set when setting list option #6166

Merged
merged 1 commit into from
Nov 2, 2023

Conversation

sphuber
Copy link
Contributor

@sphuber sphuber commented Oct 27, 2023

verdi config set would except when setting a single value for an option that is of list type, such as caching.enable_for. This only started happening after the recent move to pydantic for the configuration options. Now the Option.validate will correctly raise when trying to set a string value for a list type.

The verdi config set implementation is updated to check when it is setting a value for an option with a list type, and in that case, the value is wrapped in a list, unless the --append or --remove flags are specified.

@sphuber sphuber requested a review from unkcpz October 30, 2023 15:20
`verdi config set` would except when setting a single value for an
option that is of list type, such as `caching.enable_for`. This only
started happening after the recent move to `pydantic` for the
configuration options. Now the `Option.validate` will correctly raise
when trying to set a string value for a list type.

The `verdi config set` implementation is updated to check when it is
setting a value for an option with a list type, and in that case, the
value is wrapped in a list, unless the `--append` or `--remove` flags
are specified.
@sphuber sphuber force-pushed the fix/verdi-config-set-list branch from 98bea23 to b1e3b5a Compare November 2, 2023 13:59
@sphuber sphuber merged commit 3149178 into aiidateam:main Nov 2, 2023
17 checks passed
@sphuber sphuber deleted the fix/verdi-config-set-list branch November 2, 2023 14:41
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.

1 participant