Fix race in fakenodepool

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

Change-Id: I73de9051bd533c271a9435ac4819c8876b678f7c
This commit is contained in:
James E. Blair 2017-02-02 11:25:16 -08:00
parent bd96363105
commit 0ef64f85c4
1 changed files with 7 additions and 4 deletions

View File

@ -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):