From 9c9a370867a3cf5e64a5373cbebf1794ebc15610 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Romain=20Tarti=C3=A8re?= Date: Thu, 7 Dec 2023 23:41:26 -1000 Subject: [PATCH] Fix `riemann-haproxy` NoMethodError Previous refactoring was intended to make the code testable to unbreak it, but a copy/paste error in the non-tested code path was introduced causing an exception at runtime: ``` NoMethodError undefined method `body' for nil:NilClass ``` Move the line at the right position where `res` is available. --- lib/riemann/tools/haproxy.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/riemann/tools/haproxy.rb b/lib/riemann/tools/haproxy.rb index 0728da78..2079ba85 100644 --- a/lib/riemann/tools/haproxy.rb +++ b/lib/riemann/tools/haproxy.rb @@ -57,8 +57,8 @@ def body get.basic_auth userinfo[0], userinfo[1] end h.request get - res.body end + res.body end end end