Default zone can not be renamed
Bug #2055009 reported by
Jacopo Rota
This bug affects 1 person
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
MAAS |
Fix Released
|
Medium
|
Jacopo Rota |
Bug Description
Resurrecting bug https:/
A user can
- create a zone `test`
- rename the default zone to `my_new_default`
- delete the zone `test`
=> a new `default` zone gets created.
Meaning that it's not possible to rename the `default` zone as it's possible to trigger the creation of it in multiple ways.
### More info abut the bug
In multiple places there is a call to https:/
Related branches
~r00ta/maas:lp-2055009-rename-default-zone
Merged
into
maas:master
- Björn Tillenius: Approve
- MAAS Lander: Approve
-
Diff: 691 lines (+236/-70)17 files modifiedsrc/maasserver/api/tests/test_zone.py (+6/-6)
src/maasserver/forms/__init__.py (+5/-4)
src/maasserver/forms/pods.py (+3/-2)
src/maasserver/forms/tests/test_zone.py (+4/-3)
src/maasserver/forms/vmcluster.py (+2/-2)
src/maasserver/migrations/maasserver/0001_initial.py (+19/-1)
src/maasserver/migrations/maasserver/0147_pod_zones.py (+18/-1)
src/maasserver/migrations/maasserver/0248_auto_20211006_1829.py (+18/-1)
src/maasserver/migrations/maasserver/0316_add_defaultresource_table.py (+73/-0)
src/maasserver/migrations/maasserver/0317_migrate_defaultresource_zone.py (+31/-0)
src/maasserver/models/__init__.py (+2/-0)
src/maasserver/models/defaultresource.py (+25/-0)
src/maasserver/models/node.py (+2/-1)
src/maasserver/models/tests/test_zone.py (+18/-10)
src/maasserver/models/zone.py (+5/-36)
src/maasserver/testing/factory.py (+3/-2)
src/maasserver/websockets/handlers/tests/test_zone.py (+2/-1)
Changed in maas: | |
milestone: | none → 3.5.0 |
Changed in maas: | |
importance: | High → Medium |
Changed in maas: | |
status: | Triaged → In Progress |
assignee: | nobody → Jacopo Rota (r00ta) |
Changed in maas: | |
status: | In Progress → Fix Committed |
Changed in maas: | |
milestone: | 3.5.0 → 3.5.0-beta1 |
status: | Fix Committed → Fix Released |
To post a comment you must log in.
I think the main conceptual issue here is that we are identifying the "default" zone by name. We should identify it in another unique way, which could be with another table with a FK or with a new column "is_default"