From 97da8e161bcf3e99af7f7be7d31e44e89d4595d3 Mon Sep 17 00:00:00 2001 From: Trishna Guha Date: Mon, 22 May 2017 22:05:44 +0530 Subject: [PATCH] Remove deprecation for username/password eos_user, nxos_user and Doc update (#24880) (#24893) Signed-off-by: Trishna Guha (cherry picked from commit 9fb9c00092c240774699a316ed21467d449f7009) --- lib/ansible/module_utils/eos.py | 12 +++++++++--- lib/ansible/module_utils/nxos.py | 9 ++++++--- lib/ansible/modules/network/eos/eos_user.py | 1 + 3 files changed, 16 insertions(+), 6 deletions(-) diff --git a/lib/ansible/module_utils/eos.py b/lib/ansible/module_utils/eos.py index 8696a51129d..4165147f893 100644 --- a/lib/ansible/module_utils/eos.py +++ b/lib/ansible/module_utils/eos.py @@ -67,9 +67,15 @@ ARGS_DEFAULT_VALUE = { def check_args(module, warnings): provider = module.params['provider'] or {} for key in eos_argument_spec: - if key not in ['provider', 'transport', 'authorize'] and module.params[key]: - warnings.append('argument %s has been deprecated and will be ' - 'removed in a future version' % key) + if module._name == 'eos_user': + if (key not in ['username', 'password', 'provider', 'transport', 'authorize'] and + module.params[key]): + warnings.append('argument %s has been deprecated and will be ' + 'removed 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) # set argument's default value if not provided in input # This is done to avoid unwanted argument deprecation warning diff --git a/lib/ansible/module_utils/nxos.py b/lib/ansible/module_utils/nxos.py index 3e436b104b2..1d1d4af5cf8 100644 --- a/lib/ansible/module_utils/nxos.py +++ b/lib/ansible/module_utils/nxos.py @@ -63,9 +63,12 @@ ARGS_DEFAULT_VALUE = { def check_args(module, warnings): provider = module.params['provider'] or {} for key in nxos_argument_spec: - if key not in ['provider', 'transport'] and module.params[key]: - warnings.append('argument %s has been deprecated and will be ' - 'removed in a future version' % key) + if module._name == 'nxos_user': + if key not in ['password', 'provider', 'transport'] 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', 'transport'] and module.params[key]: + warnings.append('argument %s has been deprecated and will be removed in a future version' % key) # set argument's default value if not provided in input # This is done to avoid unwanted argument deprecation warning diff --git a/lib/ansible/modules/network/eos/eos_user.py b/lib/ansible/modules/network/eos/eos_user.py index 55c4cdefcad..e1a43165c22 100644 --- a/lib/ansible/modules/network/eos/eos_user.py +++ b/lib/ansible/modules/network/eos/eos_user.py @@ -46,6 +46,7 @@ options: - The username to be configured on the remote Arista EOS device. This argument accepts a stringv value and is mutually exclusive with the C(users) argument. + Please note that this option is not same as C(provider username). update_password: description: - Since passwords are encrypted in the device running config, this