Fix malformed string error using ast

Signed-off-by: NilashishC <nilashishchakraborty8@gmail.com>
pull/51007/head
NilashishC 6 years ago
parent e150943314
commit a26da30b17

@ -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')
@ -448,7 +447,7 @@ def main():
""" main entry point for module execution
"""
hashed_password_spec = dict(
type=dict(type='int', required=True),
type=dict(required=True),
value=dict(no_log=True, required=True)
)

Loading…
Cancel
Save