The argument name in the deprecation warning message should use the format "--foo-bar" instead of "foo_bar"
See original GitHub issueRelated command
$ az aks create -g binxi1114 -n binxi111401 --enable-pod-security-policy -c 1
Argument 'enable_pod_security_policy' has been deprecated and will be removed in a future release.
Argument '--enable-pod-security-policy' is in preview and under development.
Extension name (the extension in question)
It’s not an issue to a specific extension. It is a common issue.
Description of issue (in as much detail as possible)
I’m working a PR to deprecate the argument ‘–enable-pod-security-policy’, and I get the message like below. The warning message should be “Argument ‘–enable-pod-security-policy’ has been deprecated and will be removed in a future release.”. Argument 'enable_pod_security_policy'
is not good.
$ az aks create -g binxi1114 -n binxi111401 --enable-pod-security-policy -c 1
Argument 'enable_pod_security_policy' has been deprecated and will be removed in a future release.
Argument '--enable-pod-security-policy' is in preview and under development.
Issue Analytics
- State:
- Created 10 months ago
- Comments:5 (4 by maintainers)
Top Results From Across the Web
decorators in the python standard lib (@deprecated specifically)
import warnings import functools def deprecated(func): """This is a decorator which can be used to mark functions as deprecated. It will result in...
Read more >Drupal deprecation policy | Core change policies
A @deprecated PHPdoc tag that indicates when the code was deprecated, when it will be removed, and what to use instead, and an...
Read more >Python deprecation - DEV Community
How do you fix this? One obvious quick fix is to write the deprecation warning and hardcode the deprecated class name. If there...
Read more >The Straight Dope on Deprecations | Cloudbees Blog
A deprecation is a warning message that tells a user they're using some piece of code or interface that will go away soon....
Read more >twisted.python.deprecate : API documentation
The deprecated attributes will issue a warning whenever they are accessed. If the attributes being deprecated are in the same module as the ......
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
It is the designed behavior of knack to show
argument_dest
in the warning message if deprecation target is not specified:https://github.com/microsoft/knack/blob/cd590312b9b4ea1402d7a0a76814f6ca4da7fab8/knack/arguments.py#L221-L222
To override the
enable_pod_security_policy
in the warning message, please specifyHere is an example from
resource
command module:https://github.com/Azure/azure-cli/blob/5b91300bb788d59683461b4570854c41dd8c3659/src/azure-cli/azure/cli/command_modules/resource/_params.py#L390-L391
Another example from
vm
command module:https://github.com/Azure/azure-cli/blob/93b5083fe5d60bd29ff37ad3e1b32e8a600d3441/src/azure-cli/azure/cli/command_modules/vm/_params.py#L209-L210
@bingosummer Thanks for bringing this up! Looks like that is how it is handled in the knack framework (this code here) but looks like if you use the
options_list
parameter when defining the argument, it would be as expected.Nonetheless, I believe showing the argument is not best for customers since that would just be confusing. @yonzhan @jiasli Could you share insights on why the default behavior is so?