Fix malformed string error for hashed_password
diff --git a/lib/ansible/modules/network/ios/ios_user.py b/lib/ansible/modules/network/ios/ios_user.py
index 8d675ac8d5a432..9969dc56525fe8 100644
--- a/lib/ansible/modules/network/ios/ios_user.py
+++ b/lib/ansible/modules/network/ios/ios_user.py
@@ -213,7 +213,6 @@
 from copy import deepcopy
 
 import re
-import ast
 import base64
 import hashlib
 
@@ -269,8 +268,8 @@ def add(command, want, x):
         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')

Signed-off-by: NilashishC <nilashishchakraborty8@gmail.com>

##### SUMMARY
- Fixes malformed string error while attempting to set hashed_passwords on IOS devices

##### ISSUE TYPE
- Bugfix Pull Request

##### COMPONENT NAME
ios_user.py