not ignored.
@@ -278,12 +278,15 @@ class Monitor:
'no handler for routing_key {0}'.format(routing_key))
return {}, False
+ def _not_ignored_endpoints(self):
+ return [endpoint for endpoint in self.s.endpoints.values() if not endpoint.ignore]
+
def schedule_mirroring(self):
queued_endpoints = [
- endpoint for endpoint in self.s.endpoints.values()
- if not endpoint.ignore and endpoint.state == 'queued' and endpoint.p_next_state != 'inactive']
+ endpoint for endpoint in self._not_ignored_endpoints()
+ if endpoint.state == 'queued' and endpoint.p_next_state != 'inactive']
self.s.investigations = len([
- endpoint for endpoint in self.s.endpoints.values()
+ endpoint for endpoint in self._not_ignored_endpoints()
if endpoint.state in ['mirroring', 'reinvestigating']])
# mirror things in the order they got added to the queue
queued_endpoints = sorted(
@@ -303,8 +306,7 @@ class Monitor:
endpoint.p_prev_state = (endpoint.state, int(time.time()))
self.s.mirror_endpoint(endpoint)
- for endpoint in self.s.endpoints.values():
- if not endpoint.ignore:
+ for endpoint in self._not_ignored_endpoints():
if self.s.sdnc:
if endpoint.state == 'unknown':
endpoint.p_next_state = 'mirror'
