mirror of
https://github.com/ansible-collections/community.general.git
synced 2026-04-02 00:33:09 +00:00
Fixes bug #10281 - Trailing zeros were truncated from strings
This commit is contained in:
@@ -54,11 +54,11 @@ class InventoryParser(object):
|
||||
def _parse_value(v):
|
||||
if "#" not in v:
|
||||
try:
|
||||
re = ast.literal_eval(v)
|
||||
if type(re) == float:
|
||||
ret = ast.literal_eval(v)
|
||||
if type(ret) == float:
|
||||
# Do not trim floats. Eg: "1.20" to 1.2
|
||||
return v
|
||||
return re
|
||||
return ret
|
||||
# Using explicit exceptions.
|
||||
# Likely a string that literal_eval does not like. We wil then just set it.
|
||||
except ValueError:
|
||||
|
||||
Reference in New Issue
Block a user