From 75faa63ee40a7de8eaa7c8f2b2f95038c0e92158 Mon Sep 17 00:00:00 2001 From: Paul Glass Date: Fri, 30 Sep 2016 21:35:56 +0000 Subject: [PATCH] Switch HAProxy health check timeout to seconds Change-Id: I6e3c68be26cdf9ed3e09b7f0bd92a52491b5e866 Closes-Bug: #1600326 --- .../drivers/haproxy/templates/haproxy_proxies.j2 | 2 +- .../tests/unit/drivers/haproxy/test_jinja_cfg.py | 12 ++++++------ 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/neutron_lbaas/drivers/haproxy/templates/haproxy_proxies.j2 b/neutron_lbaas/drivers/haproxy/templates/haproxy_proxies.j2 index 573533a3a..c72fdd986 100644 --- a/neutron_lbaas/drivers/haproxy/templates/haproxy_proxies.j2 +++ b/neutron_lbaas/drivers/haproxy/templates/haproxy_proxies.j2 @@ -69,7 +69,7 @@ backend {{ pool.id }} {% endif %} {% endif %} {% if pool.health_monitor %} - timeout check {{ pool.health_monitor.timeout }} + timeout check {{ pool.health_monitor.timeout }}s {% if pool.health_monitor.type == constants.HEALTH_MONITOR_HTTP or pool.health_monitor.type == constants.HEALTH_MONITOR_HTTPS %} option httpchk {{ pool.health_monitor.http_method }} {{ pool.health_monitor.url_path }} http-check expect rstatus {{ pool.health_monitor.expected_codes }} diff --git a/neutron_lbaas/tests/unit/drivers/haproxy/test_jinja_cfg.py b/neutron_lbaas/tests/unit/drivers/haproxy/test_jinja_cfg.py index f384e529f..27a2b592e 100644 --- a/neutron_lbaas/tests/unit/drivers/haproxy/test_jinja_cfg.py +++ b/neutron_lbaas/tests/unit/drivers/haproxy/test_jinja_cfg.py @@ -64,7 +64,7 @@ class TestHaproxyCfg(base.BaseTestCase): " mode http\n" " balance roundrobin\n" " cookie SRV insert indirect nocache\n" - " timeout check 31\n" + " timeout check 31s\n" " option httpchk GET /index.html\n" " http-check expect rstatus %s\n" " server sample_member_id_1 10.0.0.99:82" @@ -109,7 +109,7 @@ class TestHaproxyCfg(base.BaseTestCase): " mode http\n" " balance roundrobin\n" " cookie SRV insert indirect nocache\n" - " timeout check 31\n" + " timeout check 31s\n" " option httpchk GET /index.html\n" " http-check expect rstatus %s\n" " server sample_member_id_1 10.0.0.99:82 " @@ -141,7 +141,7 @@ class TestHaproxyCfg(base.BaseTestCase): " mode http\n" " balance roundrobin\n" " cookie SRV insert indirect nocache\n" - " timeout check 31\n" + " timeout check 31s\n" " option httpchk GET /index.html\n" " http-check expect rstatus %s\n" " server sample_member_id_1 10.0.0.99:82 " @@ -167,7 +167,7 @@ class TestHaproxyCfg(base.BaseTestCase): " mode tcp\n" " balance roundrobin\n" " cookie SRV insert indirect nocache\n" - " timeout check 31\n" + " timeout check 31s\n" " option httpchk GET /index.html\n" " http-check expect rstatus %s\n" " option ssl-hello-chk\n" @@ -258,7 +258,7 @@ class TestHaproxyCfg(base.BaseTestCase): " balance roundrobin\n" " stick-table type ip size 10k\n" " stick on src\n" - " timeout check 31\n" + " timeout check 31s\n" " option httpchk GET /index.html\n" " http-check expect rstatus %s\n" " server sample_member_id_1 10.0.0.99:82 " @@ -282,7 +282,7 @@ class TestHaproxyCfg(base.BaseTestCase): " mode http\n" " balance roundrobin\n" " appsession APP_COOKIE len 56 timeout 3h\n" - " timeout check 31\n" + " timeout check 31s\n" " option httpchk GET /index.html\n" " http-check expect rstatus %s\n" " server sample_member_id_1 10.0.0.99:82 "