mirror of
https://github.com/ansible-collections/community.general.git
synced 2025-10-05 07:54:00 -07:00
Fix unwanted deprecation message in network module args (#28984)
* Fix unwanted deprecation message in network module argspec Fixes #25663 Fixes #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
This commit is contained in:
parent
d52316fcc2
commit
599fe23ed6
30 changed files with 283 additions and 634 deletions
|
@ -49,13 +49,19 @@ sros_provider_spec = {
|
|||
sros_argument_spec = {
|
||||
'provider': dict(type='dict', options=sros_provider_spec),
|
||||
}
|
||||
sros_argument_spec.update(sros_provider_spec)
|
||||
sros_top_spec = {
|
||||
'host': dict(removed_in_version=2.3),
|
||||
'port': dict(removed_in_version=2.3, type='int'),
|
||||
'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'),
|
||||
'timeout': dict(removed_in_version=2.3, type='int'),
|
||||
}
|
||||
sros_argument_spec.update(sros_top_spec)
|
||||
|
||||
|
||||
def check_args(module, warnings):
|
||||
for key in sros_argument_spec:
|
||||
if key != 'provider' and module.params[key]:
|
||||
warnings.append('argument %s has been deprecated and will be removed in a future version' % key)
|
||||
pass
|
||||
|
||||
|
||||
def get_config(module, flags=None):
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue