Change network *_user modules to use configured_password to set a users password (#28187)

* WIP, update eos_user args

* refactor password for ios_user

* add eos tests, fix ios tests

* fixed password check

* refactor iosxr_user password

* fixed password arg for nxos

* [WIP] fix vyos_user password

* fix vyos tests

* update docs for net_user

* fix typo

* fix eos tests

* add warning when attempting to use password arg

* fix sanity/unit tests

* fix eos unit tests

* fix vyos_user aggregate

* fix typo in eos documentation string

* re add configured_password to vyos tests after rebase
This commit is contained in:
David Newswanger 2017-08-17 09:36:44 -04:00 committed by Trishna Guha
commit b818e986b6
18 changed files with 329 additions and 70 deletions

View file

@ -46,7 +46,7 @@ class TestVyosUserModule(TestVyosModule):
self.load_config.return_value = dict(diff=None, session='session')
def test_vyos_user_password(self):
set_module_args(dict(name='ansible', password='test'))
set_module_args(dict(name='ansible', configured_password='test'))
result = self.execute_module(changed=True)
self.assertEqual(result['commands'], ['set system login user ansible authentication plaintext-password test'])
@ -71,15 +71,15 @@ class TestVyosUserModule(TestVyosModule):
'delete system login user admin']))
def test_vyos_user_update_password_changed(self):
set_module_args(dict(name='test', password='test', update_password='on_create'))
set_module_args(dict(name='test', configured_password='test', update_password='on_create'))
result = self.execute_module(changed=True)
self.assertEqual(result['commands'], ['set system login user test authentication plaintext-password test'])
def test_vyos_user_update_password_on_create_ok(self):
set_module_args(dict(name='ansible', password='test', update_password='on_create'))
set_module_args(dict(name='ansible', configured_password='test', update_password='on_create'))
self.execute_module()
def test_vyos_user_update_password_always(self):
set_module_args(dict(name='ansible', password='test', update_password='always'))
set_module_args(dict(name='ansible', configured_password='test', update_password='always'))
result = self.execute_module(changed=True)
self.assertEqual(result['commands'], ['set system login user ansible authentication plaintext-password test'])