mirror of
https://github.com/ansible-collections/community.general.git
synced 2025-07-22 12:50:22 -07:00
Reverse the conditional so there's one less return from this function
This commit is contained in:
parent
d0f8df4bdb
commit
084fbbdea9
1 changed files with 2 additions and 3 deletions
|
@ -55,10 +55,9 @@ class InventoryParser(object):
|
|||
if "#" not in v:
|
||||
try:
|
||||
ret = ast.literal_eval(v)
|
||||
if type(ret) == float:
|
||||
if not isinstance(ret, float):
|
||||
# Do not trim floats. Eg: "1.20" to 1.2
|
||||
return v
|
||||
return ret
|
||||
return ret
|
||||
# Using explicit exceptions.
|
||||
# Likely a string that literal_eval does not like. We wil then just set it.
|
||||
except ValueError:
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue