Fix for cherry-pick e8dddc3679,

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: adc158a499 made this buggy behaviour
apparent.
This commit is contained in:
Toshio Kuratomi 2016-09-21 21:45:03 -07:00
parent 9de21e1eaa
commit e917a0bd7a

View file

@ -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))