mirror of
https://github.com/ansible-collections/community.general.git
synced 2026-05-07 13:52:54 +00:00
Allow float as an argument type in AnsibleModule
This commit is contained in:
@@ -706,6 +706,12 @@ class AnsibleModule(object):
|
|||||||
self.params[k] = int(value)
|
self.params[k] = int(value)
|
||||||
else:
|
else:
|
||||||
is_invalid = True
|
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:
|
else:
|
||||||
self.fail_json(msg="implementation error: unknown type %s requested for %s" % (wanted, k))
|
self.fail_json(msg="implementation error: unknown type %s requested for %s" % (wanted, k))
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user