Consider removing transaction in claim_static_ip_addresses().
Bug #1379370 reported by
Jason Hobbs
This bug affects 1 person
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
MAAS |
Fix Released
|
High
|
Julian Edwards |
Bug Description
It's not clear to me that this transaction needs to be here since claim_static_
Related branches
lp:~julian-edwards/maas/tech-debt-bug-1379370
- Graham Binns (community): Approve
- Newell Jensen (community): Approve
-
Diff: 33 lines (+8/-14)1 file modifiedsrc/maasserver/models/node.py (+8/-14)
Changed in maas: | |
status: | New → Triaged |
importance: | Undecided → High |
milestone: | none → next |
tags: | added: tech-debt |
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 |
To post a comment you must log in.
The use of transaction. atomic( ) in there is under the assumption that we're already within a transaction. It should only be creating a savepoint on entry, and rolling back to it if there's an exception on exit. Django defines this behaviour when using atomic() within a transaction, iirc.
Also, claim_static_ ip_addresses( ) *does* allocate addresses for multiple interfaces. Using a savepoint here means we get all-or-nothing behaviour.