-
Notifications
You must be signed in to change notification settings - Fork 43
Use quorum=True for etcd reads in IPAM. #49
Conversation
handle_id, | ||
attributes) | ||
try: | ||
ips = self._auto_assign_block(block_id, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If this is the last block and you get a KeyError (because the client creating this block hasn't written it yet) - shouldn't we be retrying rather than potentially creating a new affine block below.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done!
1b43dcf
to
7893c7a
Compare
allocated_ips = [] | ||
|
||
num_remaining = num | ||
while num_remaining > 0: | ||
try: | ||
block_id = block_ids.next() | ||
except StopIteration: | ||
block_id = block_ids.pop() |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
pop(0) could have been used instead of needing to reverse the list - but not fussed either way
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Today I Learned...
7893c7a
to
f880765
Compare
LGTM |
Use quorum=True for etcd reads in IPAM.
Fixes #47