From bf96f5f690cb418ed00f77a32f692015b03a4969 Mon Sep 17 00:00:00 2001 From: Michael Elkins Date: Wed, 27 Apr 2016 17:01:26 +0000 Subject: Catch exceptions from Zookeeper to gracefully continue when we can't talk to rpkid. closes #805 svn path=/branches/tk705/; revision=6394 --- rpki/gui/gui_rpki_cache/util.py | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) (limited to 'rpki/gui/gui_rpki_cache/util.py') diff --git a/rpki/gui/gui_rpki_cache/util.py b/rpki/gui/gui_rpki_cache/util.py index 4798447b..0bc4fa5d 100644 --- a/rpki/gui/gui_rpki_cache/util.py +++ b/rpki/gui/gui_rpki_cache/util.py @@ -215,8 +215,15 @@ def fetch_published_objects(): type = "query", version = rpki.left_right.version) for h in handles: SubElement(q_msg, rpki.left_right.tag_list_published_objects, tenant_handle=h, tag=h) - z = Zookeeper() - r_msg = z.call_rpkid(q_msg) + try: + z = Zookeeper() + r_msg = z.call_rpkid(q_msg) + except Exception as err: + logger.error('Unable to connect to rpkid to fetch list of published objects') + logger.exception(err) + # Should be safe to continue processing the rcynic cache, we just don't do any notifications + return + for r_pdu in r_msg: if r_pdu.tag == rpki.left_right.tag_list_published_objects: # Look up the object in the rcynic cache -- cgit v1.2.3