Commit a14248ff by Alvaro Lopez Ortega

Fixes bug #10281 - Trailing zeros were truncated from strings

parent 1cb47c80
...@@ -54,7 +54,11 @@ class InventoryParser(object): ...@@ -54,7 +54,11 @@ class InventoryParser(object):
def _parse_value(v): def _parse_value(v):
if "#" not in v: if "#" not in v:
try: try:
return ast.literal_eval(v) re = ast.literal_eval(v)
if type(re) == float:
# Do not trim floats. Eg: "1.20" to 1.2
return v
return re
# Using explicit exceptions. # Using explicit exceptions.
# Likely a string that literal_eval does not like. We wil then just set it. # Likely a string that literal_eval does not like. We wil then just set it.
except ValueError: except ValueError:
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment