-
Notifications
You must be signed in to change notification settings - Fork 23.7k
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
Fix unwanted deprecation message in network module args #28984
Conversation
Fixes ansible#25663 Fixes ansible#24537 * segregate provider spec and top level arg spec * add deprecation key in top level arg spec * remove action plugin code to load provider and add that logic at a common place in network_common.py file
Maybe I missed it skimming the changes, but why split $NOS_argument_spec and $NOS_top_spec and not just have $NOS_argument_spec? |
@Qalthos The top level arguments like However in $NOS_argument_spec there is a fallback for environment variable for these args. So if env variable is set, for current implementation it will end up throwing a warning message even if the arg is not mentioned in play which is not the expected behavior (refer the linked issues in summary for more details). With a separate spec $NOS_top_spec there is no environment fall back so now warning will be shown only when these deprecated args are present at the top level of a task. Also, the The fallback environment variable in $NOS_provider_spec will map to the respective argument inside provider spec without any deprecation warning in output. |
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.
Transport, authorize don't consistently have removed_in_version.
'username': dict(removed_in_version=2.3), | ||
'password': dict(removed_in_version=2.3, no_log=True), | ||
'ssh_keyfile': dict(removed_in_version=2.3, type='path'), | ||
'authorize': dict(type='bool'), |
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.
Why is removed_in_version missing from this?
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.
In current implementation warning in not thrown if authorize
is mentioned at top level.
To keep the same behavior after refactor removed_in_version
is not added for authorize
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.
asa_config doc here confirms the same.
'use_ssl': dict(removed_in_version=2.3, type='bool'), | ||
'validate_certs': dict(removed_in_version=2.3, type='bool'), | ||
'timeout': dict(removed_in_version=2.3, type='int'), | ||
'transport': dict(choices=['cli']), |
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.
Why isn't this deprecated?
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.
Same reason as above.
Segregating top level and provider level argspec makes sense to me. LGTM overall. |
* Fix unwanted deprecation message in network module argspec Fixes ansible#25663 Fixes ansible#24537 * segregate provider spec and top level arg spec * add deprecation key in top level arg spec * remove action plugin code to load provider and add that logic at a common place in network_common.py file * Fix CI issue * Minor change
* Fix unwanted deprecation message in network module argspec Fixes ansible#25663 Fixes ansible#24537 * segregate provider spec and top level arg spec * add deprecation key in top level arg spec * remove action plugin code to load provider and add that logic at a common place in network_common.py file * Fix CI issue * Minor change
Fixes ansible#32343 * Move provider arg spec as part of suboptions to validate input args against provider spec. * This handles `no_log` for password arg correctly. Merged to devel PR ansible#28984 ( cherry picked from commit 599fe23 )
SUMMARY
Fixes #25663
Fixes #24537
the corresponding environment variable is set
that logic at a common place in network_common.py file
ISSUE TYPE
COMPONENT NAME
module_utils/aireos.py
module_utils/aruba.py
module_utils/asa.py
module_utils/ce.py
module_utils/dellos10.py
module_utils/dellos6.py
module_utils/dellos9.py
module_utils/eos.py
module_utils/ios.py
module_utils/iosxr.py
module_utils/junos.py
module_utils/network_common.py
module_utils/nxos.py
module_utils/sros.py
plugins/action/aireos.py
plugins/action/aruba.py
plugins/action/asa.py
plugins/action/ce.py
plugins/action/dellos10.py
plugins/action/dellos6.py
plugins/action/dellos9.py
plugins/action/eos.py
plugins/action/ios.py
plugins/action/iosxr.py
plugins/action/junos.py
plugins/action/net_base.py
plugins/action/nxos.py
plugins/action/sros.py
plugins/action/vyos.py
ANSIBLE VERSION
ADDITIONAL INFORMATION
Before
After
(In case environment variable for password, username etc is set and top level argument value is not given in playbook, corresponding warning will not be displayed in output. )