Fix race in fakenodepool

A request can be deleted between the time we list and fetch it.

Change-Id: I73de9051bd533c271a9435ac4819c8876b678f7c
changes/90/428390/2
James E. Blair 6 years ago
parent bd96363105
commit 0ef64f85c4

@ -908,10 +908,13 @@ class FakeNodepool(object):
reqs = []
for oid in sorted(reqids):
path = self.REQUEST_ROOT + '/' + oid
data, stat = self.client.get(path)
data = json.loads(data)
data['_oid'] = oid
reqs.append(data)
try:
data, stat = self.client.get(path)
data = json.loads(data)
data['_oid'] = oid
reqs.append(data)
except kazoo.exceptions.NoNodeError:
pass
return reqs
def getNodes(self):

Loading…
Cancel
Save