From 9b0284aa092595a459eead37923a93cac6e76f1c Mon Sep 17 00:00:00 2001 From: David Shrewsbury Date: Tue, 3 Dec 2013 10:28:01 -0500 Subject: [PATCH] [WORKER] Fix logic to find unplanned restarts The logic to determine if HAProxy was restarted outside of the worker's control was incorrect due to missing parenthesis. Change-Id: I416ec7113491583646e033038a3b9e7cf58a6174 --- libra/worker/drivers/haproxy/ubuntu_services.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/libra/worker/drivers/haproxy/ubuntu_services.py b/libra/worker/drivers/haproxy/ubuntu_services.py index e028de00..c15c3bb5 100644 --- a/libra/worker/drivers/haproxy/ubuntu_services.py +++ b/libra/worker/drivers/haproxy/ubuntu_services.py @@ -249,7 +249,8 @@ class UbuntuServices(services_base.ServicesBase): # was restarted outside of the worker's control, so we have no choice # but to zero the values to avoid overcharging on usage. if (unrpt_tcp_bo == 0 and unrpt_http_bo == 0) and \ - (prev_tcp_bo > current_tcp_bo) or (prev_http_bo > current_http_bo): + ((prev_tcp_bo > current_tcp_bo) or + (prev_http_bo > current_http_bo)): LOG.warn("Forced reset of HAProxy statistics") prev_tcp_bo = 0 prev_http_bo = 0