Comment 1 for bug 1061286

Revision history for this message
John A Meinel (jameinel) wrote :

There seems to be 2 bits to the bug, IMO

1) raising InvalidConstraint is meant to generate an HTTP 400 (BAD REQUEST) [We inherit from MAASAPiBadRequest, and I'm pretty sure there was a test for this case). So we want to understand why we are getting a traceback rather than a cleaner message.

2) How to deal with a float input. The field is 'cpu_count', so requesting 4.5 cpu's doesn't make a lot of sense. I'm wondering who generated the float, and who should be validating it. Was it
 a) Diogo just testing something out, and we should be having juju's code validating the inputs are more sane before issuing the request
 b) Diogo wrote 1, but the juju code turned the int into a float and passed it along (at one point 'cpu' was going to be a float describing something like ECU)
 c) Should we just accept float input, and do something like int(round(float(str_value)))