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>
pull/26178/head
Trishna Guha 8 years ago committed by GitHub
parent 6f73ab84c6
commit a5b905c941

@ -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…
Cancel
Save