From d7472b5eceb59bb26ba36aaaa7492b77098b9220 Mon Sep 17 00:00:00 2001 From: Steve Kemp Date: Thu, 16 Apr 2015 09:51:05 +0100 Subject: Correctly use the result of the resolution in the alert. There was a bug in that we used the same local-variable "result" for two purposes, trashing the intended use-case. --- lib/custodian/alerts/mauve.rb | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) (limited to 'lib') diff --git a/lib/custodian/alerts/mauve.rb b/lib/custodian/alerts/mauve.rb index 2b48fbc..d2b3a12 100644 --- a/lib/custodian/alerts/mauve.rb +++ b/lib/custodian/alerts/mauve.rb @@ -338,12 +338,11 @@ module Custodian # # Return the formatted message # - ips.each do |result| - - if Custodian::Util::Bytemark.inside?(result.to_s) - result += "

#{host} resolves to #{result} which is inside the Bytemark network.

" + ips.each do |ipaddr| + if Custodian::Util::Bytemark.inside?(ipaddr.to_s) + result += "

#{host} resolves to #{ipaddr} which is inside the Bytemark network.

" else - result += "

#{host} resolves to #{result} which is OUTSIDE the Bytemark network.

" + result += "

#{host} resolves to #{ipaddr} which is OUTSIDE the Bytemark network.

" end end -- cgit v1.2.1