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

Fixes https://github.com/ansible/ansible-modules-core/issues/4084
pull/16434/merge
Toshio Kuratomi 8 years ago committed by GitHub
parent 811fc385ee
commit 71ef25d5e8

@ -1505,7 +1505,7 @@ class AnsibleModule(object):
if isinstance(value, float): if isinstance(value, float):
return value return value
if isinstance(value, string_types): if isinstance(value, (binary_type, text_type, int)):
return float(value) return float(value)
raise TypeError('%s cannot be converted to a float' % type(value)) raise TypeError('%s cannot be converted to a float' % type(value))

Loading…
Cancel
Save