Skip to content

Commit 6ac61ef

Browse files
author
Ben Prew
committedJan 4, 2021
Fix bug with checking header variable
header is set outside haproxy_response, so it's always defined. Check changed to non-nil value, instead of using defined?. This bug was introduced in 67db1dd.
1 parent 0a1caf1 commit 6ac61ef

File tree

1 file changed

+1
-2
lines changed

1 file changed

+1
-2
lines changed
 

‎check_haproxy.rb

+1-2
Original file line numberDiff line numberDiff line change
@@ -146,11 +146,10 @@ def exit_code(code=0)
146146
header = nil
147147

148148
haproxy_response(options).each do |line|
149-
150149
if line =~ /^# /
151150
header = line[2..-1].split(',')
152151
next
153-
elsif !defined? header
152+
elsif !header
154153
puts "ERROR: CSV header is missing"
155154
exit UNKNOWN
156155
end

0 commit comments

Comments
 (0)
Please sign in to comment.