Patchwork [bitbake-devel,08/14] toaster: catch IndexError error in dictionary lookups

login
register
mail settings
Submitter Alexandru DAMIAN
Date April 4, 2014, 2:10 p.m.
Message ID <bbe2bfb9c513107261faf24d7a20e482a7a9d2ea.1396620556.git.alexandru.damian@intel.com>
Download mbox | patch
Permalink /patch/70123/
State New
Headers show

Comments

Alexandru DAMIAN - April 4, 2014, 2:10 p.m.
From: David Reyna <David.Reyna@windriver.com>

In the get_dict_value filter, there is the edge case where halted
builds can lead to IndexError errors in dictionary lookups, so we
need to catch those.

[YOCTO #6067]

Signed-off-by: David Reyna <David.Reyna@windriver.com>
---
 lib/toaster/toastergui/templatetags/projecttags.py | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Patch

diff --git a/lib/toaster/toastergui/templatetags/projecttags.py b/lib/toaster/toastergui/templatetags/projecttags.py
index 3dd0f3d..ee08ab7 100644
--- a/lib/toaster/toastergui/templatetags/projecttags.py
+++ b/lib/toaster/toastergui/templatetags/projecttags.py
@@ -247,5 +247,5 @@  def get_dict_value(dictionary, key):
     """
     try:
         return dictionary[key]
-    except KeyError:
+    except (KeyError, IndexError):
         return ''