Merge pull request #5594 from willthames/allow_float_type

Allow float as an argument type in AnsibleModule
pull/4420/head
Michael DeHaan 2014-01-13 11:25:01 -08:00
commit ca112f64a6
1 changed files with 6 additions and 0 deletions

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