summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSteve Kemp <steve@steve.org.uk>2015-04-16 09:51:05 +0100
committerSteve Kemp <steve@steve.org.uk>2015-04-16 09:51:05 +0100
commitd64b72dd1f24d29a3f0ecd4d9a0039fbf5a2644e (patch)
treece0eaf8d7325effa81b9cef7ec228dd454553e6b
parentf7bc3ebb027dfe18cbb97f698db9c7d7eceb07f1 (diff)
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.
-rw-r--r--lib/custodian/alerts/mauve.rb9
1 files changed, 4 insertions, 5 deletions
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 += "<p>#{host} resolves to #{result} which is inside the Bytemark network.</p>"
+ ips.each do |ipaddr|
+ if Custodian::Util::Bytemark.inside?(ipaddr.to_s)
+ result += "<p>#{host} resolves to #{ipaddr} which is inside the Bytemark network.</p>"
else
- result += "<p>#{host} resolves to #{result} which is OUTSIDE the Bytemark network.</p>"
+ result += "<p>#{host} resolves to #{ipaddr} which is OUTSIDE the Bytemark network.</p>"
end
end