From 2649062d80bb9b996ba82791d69a54497f5b9e81 Mon Sep 17 00:00:00 2001 From: Fei Long Wang Date: Tue, 20 Jan 2015 13:58:28 +1300 Subject: [PATCH] Check marker before accessing it When pool is enabled, current code will return marker_name['next'] no matter if there is the key 'next' in it. Then user will run into a KeyError issue. This fix will change it and keep it consistent with the behaviour of no pool. Closes-Bug: #1412608 Change-Id: Iea66f99482146c38615fccc3060ab56f7ff98d9e --- zaqar/storage/pooling.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/zaqar/storage/pooling.py b/zaqar/storage/pooling.py index 6dfaca194..49d611587 100644 --- a/zaqar/storage/pooling.py +++ b/zaqar/storage/pooling.py @@ -166,7 +166,7 @@ class QueueController(storage.Queue): yield queue_cmp.obj yield it() - yield marker_name['next'] + yield marker_name and marker_name['next'] def _get(self, name, project=None): try: