mirror of
https://github.com/ansible-collections/community.general.git
synced 2026-05-06 05:12:45 +00:00
Fix malformed string error for hashed_password (#51007)
* Fix malformed string error using ast Signed-off-by: NilashishC <nilashishchakraborty8@gmail.com> * Update doc for this option Signed-off-by: NilashishC <nilashishchakraborty8@gmail.com> * Revert "Update doc for this option" This reverts commit 3579d1912129ab14d5009785ba896de820063d46. * Revert type value Signed-off-by: NilashishC <nilashishchakraborty8@gmail.com>
This commit is contained in:
committed by
GitHub
parent
3dc5ba6186
commit
422604fb3e
@@ -213,7 +213,6 @@ commands:
|
||||
from copy import deepcopy
|
||||
|
||||
import re
|
||||
import ast
|
||||
import base64
|
||||
import hashlib
|
||||
|
||||
@@ -269,8 +268,8 @@ def map_obj_to_commands(updates, module):
|
||||
command.append('username %s %s' % (want['name'], x))
|
||||
|
||||
def add_hashed_password(command, want, x):
|
||||
command.append('username %s secret %s %s' % (want['name'], ast.literal_eval(x)['type'],
|
||||
ast.literal_eval(x)['value']))
|
||||
command.append('username %s secret %s %s' % (want['name'], x.get('type'),
|
||||
x.get('value')))
|
||||
|
||||
def add_ssh(command, want, x=None):
|
||||
command.append('ip ssh pubkey-chain')
|
||||
|
||||
Reference in New Issue
Block a user