Browse code

For module parameter checking, allow conversion of int to float (#17325)

Fixes https://github.com/ansible/ansible-modules-core/issues/4084

Toshio Kuratomi authored on 2016/09/01 00:57:47
Showing 1 changed files
... ...
@@ -1483,7 +1483,7 @@ class AnsibleModule(object):
1483 1483
         if isinstance(value, float):
1484 1484
             return value
1485 1485
 
1486
-        if isinstance(value, basestring):
1486
+        if isinstance(value, (binary_type, text_type, int)):
1487 1487
             return float(value)
1488 1488
 
1489 1489
         raise TypeError('%s cannot be converted to a float' % type(value))