1
0
Fork 0
mirror of https://github.com/ansible-collections/community.general.git synced 2024-09-14 20:13:21 +02: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:
Trishna Guha 2017-06-28 15:11:27 +05:30 committed by GitHub
parent 6f73ab84c6
commit a5b905c941
3 changed files with 18 additions and 6 deletions

View file

@ -52,8 +52,12 @@ def get_argspec():
def check_args(module, warnings):
provider = module.params['provider'] or {}
for key in ios_argument_spec:
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 module._name == 'ios_user':
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:
for param in ('auth_pass', 'password'):

View file

@ -51,8 +51,12 @@ def get_argspec():
def check_args(module, warnings):
provider = module.params['provider'] or {}
for key in iosxr_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)
if module._name == 'iosxr_user':
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:
for param in ('password',):

View file

@ -52,8 +52,12 @@ def get_argspec():
def check_args(module, warnings):
provider = module.params['provider'] or {}
for key in vyos_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)
if module._name == 'vyos_user':
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:
for param in ('password',):