From c226c1015e7bc353aeefdf76b5cb19fbbfae0d75 Mon Sep 17 00:00:00 2001 From: kr3ator <48438188+kr3ator@users.noreply.github.com> Date: Fri, 13 Sep 2019 12:19:06 +0200 Subject: [PATCH] Update junos_user.py (#60459) --- lib/ansible/modules/network/junos/junos_user.py | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/lib/ansible/modules/network/junos/junos_user.py b/lib/ansible/modules/network/junos/junos_user.py index 1c9c3ed2ac6..697cbc4af62 100644 --- a/lib/ansible/modules/network/junos/junos_user.py +++ b/lib/ansible/modules/network/junos/junos_user.py @@ -224,8 +224,7 @@ def map_obj_to_ele(module, want): SubElement(user, 'full-name').text = item['full_name'] if item.get('sshkey'): - if 'auth' not in locals(): - auth = SubElement(user, 'authentication') + auth = SubElement(user, 'authentication') if 'ssh-rsa' in item['sshkey']: ssh_rsa = SubElement(auth, 'ssh-rsa') elif 'ssh-dss' in item['sshkey']: @@ -237,8 +236,7 @@ def map_obj_to_ele(module, want): key = SubElement(ssh_rsa, 'name').text = item['sshkey'] if item.get('encrypted_password'): - if 'auth' not in locals(): - auth = SubElement(user, 'authentication') + auth = SubElement(user, 'authentication') SubElement(auth, 'encrypted-password').text = item['encrypted_password'] return element