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.
pull/17726/head
Toshio Kuratomi 8 years ago
parent 9de21e1eaa
commit e917a0bd7a

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

Loading…
Cancel
Save