1
0
Fork 0
mirror of https://github.com/ansible-collections/community.general.git synced 2024-09-14 20:13:21 +02:00

Allow float as an argument type in AnsibleModule

This commit is contained in:
willthames 2014-01-13 14:15:23 +10:00
parent 2f5fe5f7c9
commit 31f5ecea60

View file

@ -706,6 +706,12 @@ class AnsibleModule(object):
self.params[k] = int(value)
else:
is_invalid = True
elif wanted == 'float':
if not isinstance(value, float):
if isinstance(value, basestring):
self.params[k] = float(value)
else:
is_invalid = True
else:
self.fail_json(msg="implementation error: unknown type %s requested for %s" % (wanted, k))