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 3579d19121
.
* Revert type value
Signed-off-by: NilashishC <nilashishchakraborty8@gmail.com>
This commit is contained in:
parent
3dc5ba6186
commit
422604fb3e
1 changed files with 2 additions and 3 deletions
|
@ -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')
|
||||
|
|
Loading…
Reference in a new issue