From 622331a4507a6a39ec8974e185cd0d1b31ec4d82 Mon Sep 17 00:00:00 2001 From: Andrew Hutchings Date: Thu, 16 May 2013 22:14:23 +0100 Subject: [PATCH] Use the new deleted flag in statsd Change-Id: Ifd453044ff2ac4007516aa8963571d45a135479d --- libra/statsd/gearman.py | 5 +++++ libra/statsd/scheduler.py | 6 ------ 2 files changed, 5 insertions(+), 6 deletions(-) diff --git a/libra/statsd/gearman.py b/libra/statsd/gearman.py index bdef0361..f2b259f4 100644 --- a/libra/statsd/gearman.py +++ b/libra/statsd/gearman.py @@ -42,6 +42,11 @@ class GearJobs(object): retry_list.append(ping.job.task) continue if ping.result['hpcs_response'] == 'FAIL': + if ( + 'status' in ping.result and + ping.result['status'] == 'DELETED' + ): + continue # Error returned by Gearman failed_list.append(ping.job.task) continue diff --git a/libra/statsd/scheduler.py b/libra/statsd/scheduler.py index 437605af..8ba56027 100644 --- a/libra/statsd/scheduler.py +++ b/libra/statsd/scheduler.py @@ -132,14 +132,8 @@ class Sched(object): return tested, repaired def _send_fails(self, failed_nodes, node_list): - api = AdminAPI(self.args.api_server, self.logger) for node in failed_nodes: data = self._get_node(node, node_list) - # device could have been marked offline between getting the list - # and testing, check if this is the case - status_code, device_status = api.get_device(data['id']) - if device_status['status'] != 'ONLINE': - continue message = ( 'Load balancer failed\n'