-
Notifications
You must be signed in to change notification settings - Fork 75
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
Handle empty value for config set proxy #2984
Conversation
🌎 This PR changes translatable messages. 🌏 Please select which scenarios apply. For further explanation, please read our policy on message changes.
|
Jira: This PR is not related to a Jira item. (The PR title does not include a SC-#### reference) GitHub Issues: Launchpad Bugs: No Launchpad bugs are fixed by this PR. (No commits have LP: #### references) Documentation: The changes in this PR do not require documentation changes. 👍 this comment to confirm that this is correct. |
Might need updated translations since a new error message was added when config set value is not given. Open to suggestions for a solution to re-use other error messages than creating a new one. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks!
Let's name the error and message more specifically.
Otherwise, looks good!
42b3f5d
to
0720a13
Compare
Updated @orndorffgrant |
I am sad about this nit, but: For CI reasons, we always use that format :/ |
@@ -690,6 +690,9 @@ def action_config_set(args, *, cfg, **kwargs): | |||
raise exceptions.InvalidArgChoice( | |||
arg="<key>", choices=", ".join(config.UA_CONFIGURABLE_KEYS) | |||
) | |||
if not set_value.strip(): | |||
subparser.print_help() |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Do we need to print the help message here ? Maybe just stating that the user provided an invalid empty value is enough.
What do you think @renanrodrigo ?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is following what we do for all other errors on setting config values. I think this looks good as is.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
Why is this needed?
Currently the user can set config proxy value to empty using
pro config set http_proxy=
This fixes that, since the given proxy is invalid, an error is shown.
Fixes: [#2925]
Test Steps
Checklist
Does this PR require extra reviews?