adding a device with no mac address gives an internal server error
Bug #1566109 reported by
Tim Penhey
This bug affects 1 person
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
MAAS |
Fix Released
|
Critical
|
Mike Pontillo |
Bug Description
While testing the gomaasapi new 2.0 support, I ended up trying to create a device without specifying any mac_addresses.
This resulted in a 500 Internal server error response.
Other validation like bad hostnames, or invalid mac addresses do give 400 bad requests as expected.
Related branches
lp:~mpontillo/maas/device-api-1566109
- Mike Pontillo (community): Approve
- Gavin Panella (community): Approve
-
Diff: 160 lines (+92/-4)4 files modifiedsrc/maasserver/api/tests/test_devices.py (+18/-0)
src/maasserver/forms.py (+8/-0)
src/maasserver/tests/test_forms_device.py (+64/-2)
src/maasserver/utils/forms.py (+2/-2)
Changed in maas: | |
milestone: | none → 2.0.0 |
importance: | Undecided → Critical |
Changed in maas: | |
status: | New → In Progress |
importance: | Critical → High |
importance: | High → Critical |
assignee: | nobody → Mike Pontillo (mpontillo) |
Changed in maas: | |
status: | In Progress → Fix Committed |
Changed in maas: | |
status: | Fix Committed → Fix Released |
To post a comment you must log in.
Note: in the dev environment, I was not able to reproduce this defect exactly as described. In general, when no MACs are provided, I see:
$ bin/maas test devices create hostname=router2
{"mac_addresses": ["This field is required."]}
This is an error propagated from Django and returns a 400 (according to the logs).
However, if I structure the request like this, I do see a 500 response[1]:
$ bin/maas test devices create
'dict' object has no attribute 'getlist'
[1]: https:/ /paste. ubuntu. com/15765568/