If on a service exposed with some arguments with a built-in type among
int, long, bool or float a request is made passing a JSON with string
values instead of the intended type, the called function would have
strings as parameters instead of the expected types. This also means
that invalid strings would still be passed without error, leading to
unexpected failures. This patch tries to convert the string to the
intended type before failing with an InvalidInput exception if the
string can't be converted. This is to try and be as nice as possible
with whatever input is thrown at wsme.
Reviewed: https:/ /review. openstack. org/179839 /git.openstack. org/cgit/ stackforge/ wsme/commit/ ?id=9a0d3c1461c 272567653defdfe c1c3680939dbdb
Committed: https:/
Submitter: Jenkins
Branch: master
commit 9a0d3c1461c2725 67653defdfec1c3 680939dbdb
Author: Stéphane Bisinger <email address hidden>
Date: Mon May 4 18:41:32 2015 +0200
Convert built-in types when passed as strings
If on a service exposed with some arguments with a built-in type among
int, long, bool or float a request is made passing a JSON with string
values instead of the intended type, the called function would have
strings as parameters instead of the expected types. This also means
that invalid strings would still be passed without error, leading to
unexpected failures. This patch tries to convert the string to the
intended type before failing with an InvalidInput exception if the
string can't be converted. This is to try and be as nice as possible
with whatever input is thrown at wsme.
Closes-Bug: 1450544 d539074b78ce813 39b9464e1e0
Change-Id: I705c183bb68457