Merge lp://staging/~julian-edwards/maas/dup-boot-source-selections-bug-1360280 into lp://staging/~maas-committers/maas/trunk
Proposed by
Julian Edwards
Status: | Merged |
---|---|
Approved by: | Julian Edwards |
Approved revision: | no longer in the source branch. |
Merged at revision: | 3361 |
Proposed branch: | lp://staging/~julian-edwards/maas/dup-boot-source-selections-bug-1360280 |
Merge into: | lp://staging/~maas-committers/maas/trunk |
Diff against target: |
867 lines (+832/-0) 4 files modified
src/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) |
To merge this branch: | bzr merge lp://staging/~julian-edwards/maas/dup-boot-source-selections-bug-1360280 |
Related bugs: |
Reviewer | Review Type | Date Requested | Status |
---|---|---|---|
Graham Binns (community) | Approve | ||
Review via email: mp+241235@code.staging.launchpad.net |
Commit message
Make os, release and boot_source unique for BootSourceSelection to stop duplicate entries.
Description of the change
Add a unique index across boot_source, os and release on BootSourceSelec
This will obviously potentially fail a migration if someone has dupes already, but this really needs to go in. Since nobody was around to do a pre-imp I'm throwing this up as-is to discuss ideas:
1. Land it as-is and if it fails add a release note telling someone to remove the dupes manually (so they get to choose which to keep)
2. Add code to the migration to force-delete all but the newest entry for each boot source.
Anything else?
To post a comment you must log in.
ISTR Blake saying that we had to coalesce the entries for one OS/release rather than just dropping all-but-one, because the entries may all have different arches, subarches and labels — all of which are perfectly valid choices, but which need to be recorded in a single row, not several.
So, if we don't want to have settings go away surprisingly, (1) is a good option.
That said, could we add a persistent, user-clearable error* after doing (2) that says something like "MAAS's records of your boot source settings may have changed; check the Images tab to ensure that your boot image settings are correct."
*Not sure we actually have the facility to do this; I was thinking of the persistent error stuff, but that all seems to be auto-cleared or not at all.