Merge lp:~julian-edwards/maas/tech-debt-bug-1379370 into lp:~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: 3336
Proposed branch: lp:~julian-edwards/maas/tech-debt-bug-1379370
Merge into: lp:~maas-committers/maas/trunk
Diff against target: 33 lines (+8/-14)
1 file modified
src/maasserver/models/node.py (+8/-14)
To merge this branch: bzr merge lp:~julian-edwards/maas/tech-debt-bug-1379370
Reviewer Review Type Date Requested Status
Graham Binns (community) Approve
Newell Jensen (community) Approve
Review via email: mp+240681@code.launchpad.net

Commit message

Remove the transaction.atomic() (essentially a savepoint in Django) in claim_static_ip_addresses(), since it only claims a single IP now.

To post a comment you must log in.
Revision history for this message
Newell Jensen (newell-jensen) :
review: Approve
Revision history for this message
Graham Binns (gmb) wrote :

Winner winner chicken dinner.

review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'src/maasserver/models/node.py'
2--- src/maasserver/models/node.py 2014-11-05 06:09:28 +0000
3+++ src/maasserver/models/node.py 2014-11-05 06:19:39 +0000
4@@ -1378,21 +1378,15 @@
5 if mac is None:
6 return []
7
8- # XXX 2014-10-09 jhobbs bug=1379370
9- # It's not clear to me that this transaction needs to be here
10- # since this doesn't allocate IP addresses across multiple
11- # interfaces. This needs to be looked at some more when there is
12- # more time.
13- with transaction.atomic():
14- try:
15- static_ips = mac.claim_static_ips()
16- except StaticIPAddressTypeClash:
17- # There's already a non-AUTO IP.
18- return []
19+ try:
20+ static_ips = mac.claim_static_ips()
21+ except StaticIPAddressTypeClash:
22+ # There's already a non-AUTO IP.
23+ return []
24
25- # Return a list instead of yielding mappings as they're ready
26- # because it's all-or-nothing (hence the atomic context).
27- return [(static_ip.ip, unicode(mac)) for static_ip in static_ips]
28+ # Return a list instead of yielding mappings as they're ready
29+ # because it's all-or-nothing (hence the atomic context).
30+ return [(static_ip.ip, unicode(mac)) for static_ip in static_ips]
31
32 def get_boot_purpose(self):
33 """