mirror of
https://github.com/ansible-collections/community.general.git
synced 2025-04-23 19:01:26 -07:00
Workaround to deprecation warning when password is used as arg for *_user (#26169)
* Avoid deprecation warning for password for vyos_user argspec Signed-off-by: Trishna Guha <trishnaguha17@gmail.com> * Avoid Password deprecation for ios_user Signed-off-by: Trishna Guha <trishnaguha17@gmail.com> * Avoid Password deprecation for iosxr_user Signed-off-by: Trishna Guha <trishnaguha17@gmail.com>
This commit is contained in:
parent
6f73ab84c6
commit
a5b905c941
3 changed files with 18 additions and 6 deletions
|
@ -52,8 +52,12 @@ def get_argspec():
|
||||||
def check_args(module, warnings):
|
def check_args(module, warnings):
|
||||||
provider = module.params['provider'] or {}
|
provider = module.params['provider'] or {}
|
||||||
for key in ios_argument_spec:
|
for key in ios_argument_spec:
|
||||||
if key not in ['provider', 'authorize'] and module.params[key]:
|
if module._name == 'ios_user':
|
||||||
warnings.append('argument %s has been deprecated and will be removed in a future version' % key)
|
if key not in ['password', 'provider', 'authorize'] and module.params[key]:
|
||||||
|
warnings.append('argument %s has been deprecated and will be in a future version' % key)
|
||||||
|
else:
|
||||||
|
if key not in ['provider', 'authorize'] and module.params[key]:
|
||||||
|
warnings.append('argument %s has been deprecated and will be removed in a future version' % key)
|
||||||
|
|
||||||
if provider:
|
if provider:
|
||||||
for param in ('auth_pass', 'password'):
|
for param in ('auth_pass', 'password'):
|
||||||
|
|
|
@ -51,8 +51,12 @@ def get_argspec():
|
||||||
def check_args(module, warnings):
|
def check_args(module, warnings):
|
||||||
provider = module.params['provider'] or {}
|
provider = module.params['provider'] or {}
|
||||||
for key in iosxr_argument_spec:
|
for key in iosxr_argument_spec:
|
||||||
if key != 'provider' and module.params[key]:
|
if module._name == 'iosxr_user':
|
||||||
warnings.append('argument %s has been deprecated and will be removed in a future version' % key)
|
if key not in ['password', 'provider'] and module.params[key]:
|
||||||
|
warnings.append('argument %s has been deprecated and will be in a future version' % key)
|
||||||
|
else:
|
||||||
|
if key != 'provider' and module.params[key]:
|
||||||
|
warnings.append('argument %s has been deprecated and will be removed in a future version' % key)
|
||||||
|
|
||||||
if provider:
|
if provider:
|
||||||
for param in ('password',):
|
for param in ('password',):
|
||||||
|
|
|
@ -52,8 +52,12 @@ def get_argspec():
|
||||||
def check_args(module, warnings):
|
def check_args(module, warnings):
|
||||||
provider = module.params['provider'] or {}
|
provider = module.params['provider'] or {}
|
||||||
for key in vyos_argument_spec:
|
for key in vyos_argument_spec:
|
||||||
if key != 'provider' and module.params[key]:
|
if module._name == 'vyos_user':
|
||||||
warnings.append('argument %s has been deprecated and will be removed in a future version' % key)
|
if key not in ['password', 'provider'] and module.params[key]:
|
||||||
|
warnings.append('argument %s has been deprecated and will be in a future version' % key)
|
||||||
|
else:
|
||||||
|
if key != 'provider' and module.params[key]:
|
||||||
|
warnings.append('argument %s has been deprecated and will be removed in a future version' % key)
|
||||||
|
|
||||||
if provider:
|
if provider:
|
||||||
for param in ('password',):
|
for param in ('password',):
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue