commit bacb8cc652916859757438ab330fafa695ec72ad Author: aagbsn aagbsn@extc.org Date: Tue Sep 10 14:26:23 2013 +0200
Return the correct format --- oonib/bouncer/handlers.py | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-)
diff --git a/oonib/bouncer/handlers.py b/oonib/bouncer/handlers.py index d33dcfe..c6b249d 100644 --- a/oonib/bouncer/handlers.py +++ b/oonib/bouncer/handlers.py @@ -94,14 +94,15 @@ class Bouncer(object): # If we can, try to pick the same collector. choices = self.getHelperAddresses(helper_name) for item in response.values(): - if item['collector'] in choices.keys(): - choice = choices[item['collector']] + c = item['collector'] + h = choices[c] + if c in choices.keys(): break # Or default to a random selection else: c,h = random.choice(choices.items()) - choice = {'collector': c, 'address': h} - response[helper_name] = choice + + response[helper_name] = {'collector': c, 'address': h}
except e.TestHelperNotFound: response = {'error': 'test-helper-not-found'}