From 34eca3816d56cc1310dfde18ddb9c70f8c8abc68 Mon Sep 17 00:00:00 2001 From: Trishna Guha Date: Wed, 28 Jun 2017 12:13:27 +0530 Subject: [PATCH] fix vyos_user configuration (#26166) Signed-off-by: Trishna Guha --- lib/ansible/modules/network/vyos/vyos_user.py | 4 ++-- test/units/modules/network/vyos/test_vyos_user.py | 8 ++++---- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/lib/ansible/modules/network/vyos/vyos_user.py b/lib/ansible/modules/network/vyos/vyos_user.py index 305aeeb7e95..45872e43c10 100644 --- a/lib/ansible/modules/network/vyos/vyos_user.py +++ b/lib/ansible/modules/network/vyos/vyos_user.py @@ -122,7 +122,7 @@ commands: type: list sample: - set system login user test level operator - - set system login user authentication encrypted-password password + - set system login user authentication plaintext-password password """ import re @@ -163,7 +163,7 @@ def spec_to_commands(updates, module): if needs_update(want, have, 'password'): if update_password == 'always' or not have: - add(commands, want, 'authentication encrypted-password %s' % want['password']) + add(commands, want, 'authentication plaintext-password %s' % want['password']) return commands diff --git a/test/units/modules/network/vyos/test_vyos_user.py b/test/units/modules/network/vyos/test_vyos_user.py index ec31a0849b4..15628eb5088 100644 --- a/test/units/modules/network/vyos/test_vyos_user.py +++ b/test/units/modules/network/vyos/test_vyos_user.py @@ -48,7 +48,7 @@ class TestVyosUserModule(TestVyosModule): def test_vyos_user_password(self): set_module_args(dict(name='ansible', password='test')) result = self.execute_module(changed=True) - self.assertEqual(result['commands'], ['set system login user ansible authentication encrypted-password test']) + self.assertEqual(result['commands'], ['set system login user ansible authentication plaintext-password test']) def test_vyos_user_delete(self): set_module_args(dict(name='ansible', state='absent')) @@ -73,14 +73,14 @@ class TestVyosUserModule(TestVyosModule): def test_vyos_user_update_password_changed(self): set_module_args(dict(name='test', password='test', update_password='on_create')) result = self.execute_module(changed=True) - self.assertEqual(result['commands'], ['set system login user test authentication encrypted-password test']) + 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')) result = self.execute_module(changed=True) - self.assertEqual(result['commands'], ['set system login user ansible authentication encrypted-password test']) + self.assertEqual(result['commands'], ['set system login user ansible authentication plaintext-password test']) def test_vyos_user_update_password_always(self): set_module_args(dict(name='ansible', password='test', update_password='always')) result = self.execute_module(changed=True) - self.assertEqual(result['commands'], ['set system login user ansible authentication encrypted-password test']) + self.assertEqual(result['commands'], ['set system login user ansible authentication plaintext-password test'])