From 084fbbdea9f7a4be74efc3914ad62fa2f1a7c213 Mon Sep 17 00:00:00 2001 From: Toshio Kuratomi Date: Thu, 26 Feb 2015 22:49:11 -0800 Subject: [PATCH] Reverse the conditional so there's one less return from this function --- lib/ansible/inventory/ini.py | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/lib/ansible/inventory/ini.py b/lib/ansible/inventory/ini.py index 7d3f1636d7d..bd9a98e7f86 100644 --- a/lib/ansible/inventory/ini.py +++ b/lib/ansible/inventory/ini.py @@ -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: