Merge lp:~rvb/maas/prevent-deletion into lp:~maas-committers/maas/trunk
Proposed by
Raphaël Badin
Status: | Rejected |
---|---|
Rejected by: | Raphaël Badin |
Proposed branch: | lp:~rvb/maas/prevent-deletion |
Merge into: | lp:~maas-committers/maas/trunk |
Diff against target: |
142 lines (+26/-16) 7 files modified
src/maasserver/api/tests/test_node.py (+6/-6) src/maasserver/models/node.py (+3/-3) src/maasserver/models/tests/test_node.py (+2/-2) src/maasserver/node_action.py (+5/-2) src/maasserver/support/pertenant/tests/test_migration.py (+2/-0) src/maasserver/support/pertenant/tests/test_utils.py (+2/-0) src/maasserver/tests/test_node_action.py (+6/-3) |
To merge this branch: | bzr merge lp:~rvb/maas/prevent-deletion |
Related bugs: |
Reviewer | Review Type | Date Requested | Status |
---|---|---|---|
Jason Hobbs (community) | Disapprove | ||
Graham Binns (community) | Approve | ||
Review via email: mp+240700@code.launchpad.net |
Commit message
Do not allow the deletion of a node if it's owned by a user.
Description of the change
This is something we missed when refactoring the node lifecycle: now we have more than one state that means that a node is "in use". In this branch I changed the check that MAAS performs before allowing a node to be deleted: the check is now that it's not owned by someone. This is meant to force an admin (only an admin can delete a node) to consciously release an "in use" node before he's allowed to remove it.
To post a comment you must log in.
Unmerged revisions
- 3336. By Raphaël Badin
-
Fix test failures.
- 3335. By Raphaël Badin
-
Use username instead of str(user).
- 3334. By Raphaël Badin
-
Do not allow the deletion of a node if it's owned by a user.
Two questions though:
1. Should an admin perhaps be allowed to delete a node that they own, so a user can't grab it at just the wrong moment?
2. Where the error message interpolates the owner, does it get the owner's name, or some other representation? AFAICT the test just uses the same interpolation, so it doesn't actually prove that the message is sensible.