From eb60f4391cd3345d2febf416ca9b962d7257214c Mon Sep 17 00:00:00 2001 From: Andrew Hutchings Date: Mon, 10 Jun 2013 21:53:11 +0100 Subject: [PATCH] Statsd: Error when a Device fails with no LB attached This shouldn't happen but did happen with the Java API in staging Change-Id: I048eaf548e8208b5c42793b6d3db64e51b5792fa --- libra/statsd/scheduler.py | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/libra/statsd/scheduler.py b/libra/statsd/scheduler.py index 4f77e9b3..c5566194 100644 --- a/libra/statsd/scheduler.py +++ b/libra/statsd/scheduler.py @@ -134,7 +134,12 @@ class Sched(object): def _send_fails(self, failed_nodes, node_list): for node in failed_nodes: data = self._get_node(node, node_list) - + if not len(data['loadBalancers']): + self.logger.error( + 'Device {0} has no Loadbalancer attached'. + format(data['id']) + ) + continue message = ( 'Load balancer failed\n' 'ID: {0}\n'