From e917a0bd7aaac62c575d1960d110845443b9f019 Mon Sep 17 00:00:00 2001 From: Toshio Kuratomi Date: Wed, 21 Sep 2016 21:45:03 -0700 Subject: [PATCH] Fix for cherry-pick e8dddc36793081d601e3bf811a7d1167f01b525b, The cherry-pick allows module parameters to convert int to float, fixing bugs where a float type is required. However, it used types from the six library for python3 compatibility as well. Since we don't have six in 2.1.0 this was buggy. Merging the unittests for the problem here: adc158a499fde1ab51732ff211ae90cdfea32198 made this buggy behaviour apparent. --- lib/ansible/module_utils/basic.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/ansible/module_utils/basic.py b/lib/ansible/module_utils/basic.py index 099b2bbd64a..5c78cdabdf0 100644 --- a/lib/ansible/module_utils/basic.py +++ b/lib/ansible/module_utils/basic.py @@ -1483,7 +1483,7 @@ class AnsibleModule(object): if isinstance(value, float): return value - if isinstance(value, (binary_type, text_type, int)): + if isinstance(value, (bytes, unicode, int)): return float(value) raise TypeError('%s cannot be converted to a float' % type(value))