Skip to content
This repository was archived by the owner on Jul 2, 2020. It is now read-only.

Commit 0ce99fe

Browse files
committed
Minor refactoring
Change method to "reallocate" to better reflect what is happening.
1 parent a27ed6f commit 0ce99fe

File tree

1 file changed

+3
-4
lines changed

1 file changed

+3
-4
lines changed

recover-ipv4-space

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -144,7 +144,6 @@ class IPv4Range(object):
144144
return False
145145

146146

147-
148147
class AddressPool(object):
149148

150149
def __init__(self):
@@ -280,7 +279,7 @@ class RecoveredAddressRegistry(object):
280279
else:
281280
return (block[0].start, block[0].end)
282281

283-
def reclaim(self, start, end, allocatee):
282+
def reallocate(self, start, end, allocatee):
284283

285284
self.recovered.remove(start, end)
286285
block = IPv4Range(start, end)
@@ -296,7 +295,7 @@ class RecoveredAddressRegistry(object):
296295
document = copy.deepcopy(self.original_registry)
297296

298297
title = document.find(self.ns('title'))
299-
title.text = title.text + " (Provisional)"
298+
title.text += " (Provisional)"
300299

301300
updated = document.find(self.ns('updated'))
302301
current_date = datetime.datetime.utcnow()
@@ -414,7 +413,7 @@ def perform_algorithm(arguments):
414413
for cidr in iprange.cidr_blocks():
415414
print(" {} ({} addresses) -> {}".format(cidr, len(cidr), allocatee))
416415
allocations[allocatee].append(cidr)
417-
registry.reclaim(start, end, allocatee)
416+
registry.reallocate(start, end, allocatee)
418417
needs[allocatee] -= len(iprange)
419418

420419
if not made_allocation:

0 commit comments

Comments
 (0)