boot-source-selections api allows adding bogus and duplicated values
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
MAAS |
Fix Released
|
High
|
Julian Edwards |
Bug Description
Not sure if this is by design or what are the specific consequences of this but one can add duplicated boot source entries in the MAAS db if one runs the following command multiple times:
maas maas boot-source-
and get:
{
"labels": [
"daily"
],
"arches": [
"*"
],
"*"
],
"release": "utopic",
"id": 5,
},
{
"labels": [
"daily"
],
"arches": [
"*"
],
"*"
],
"release": "utopic",
"id": 6,
}
Or if one runs:
maas maas boot-source-
the db ends up with an empty entry like:
{
"labels": [],
"arches": [],
"release": "",
"id": 3,
},
Related branches
- Graham Binns (community): Approve
-
Diff: 867 lines (+832/-0)4 files modifiedsrc/maasserver/migrations/0115_unique_boot_source_selections.py (+433/-0)
src/maasserver/migrations/0116_unique_boot_source_selections.py (+373/-0)
src/maasserver/models/bootsourceselection.py (+1/-0)
src/maasserver/tests/test_forms_bootsourceselection.py (+25/-0)
- Graham Binns (community): Approve
-
Diff: 466 lines (+321/-38)4 files modifiedsrc/maasserver/api/tests/test_boot_source_selections.py (+24/-13)
src/maasserver/forms.py (+56/-0)
src/maasserver/testing/factory.py (+6/-0)
src/maasserver/tests/test_forms_bootsourceselection.py (+235/-25)
Changed in maas: | |
milestone: | none → 1.7.0 |
tags: | added: boot-images |
Changed in maas: | |
milestone: | 1.7.0 → next |
assignee: | Blake Rouse (blake-rouse) → nobody |
Changed in maas: | |
milestone: | next → 1.7.1 |
Changed in maas: | |
assignee: | nobody → Julian Edwards (julian-edwards) |
status: | Triaged → In Progress |
Changed in maas: | |
status: | In Progress → Fix Committed |
Changed in maas: | |
status: | Fix Committed → Fix Released |
No it is not by design. It is incorrect.