Skip to content

Commit

Permalink
simplify value conversion by removing ast.literal_eval
Browse files Browse the repository at this point in the history
  • Loading branch information
AAYUSH2091 committed Oct 28, 2024
1 parent ae17295 commit 176c3c6
Showing 1 changed file with 2 additions and 5 deletions.
7 changes: 2 additions & 5 deletions plugins/module_utils/network/common/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -685,11 +685,8 @@ def __call__(self, value, variables=None, fail_on_undefined=True):
return None
raise

if value:
try:
return ast.literal_eval(value)
except Exception:
return str(value)
if value is not None:
return str(value) # Ensuring we returning it as a string
else:
return None

Expand Down

0 comments on commit 176c3c6

Please sign in to comment.