From 1c8bf33bd7663fcb67fe854d968670aa475173dd Mon Sep 17 00:00:00 2001 From: Patrick J Cherry Date: Tue, 19 Jul 2011 16:50:49 +0100 Subject: * Fixed supressed spelling mistakes (sic) * Added require thin_parser to http_server * Fixed spurious thaw attempts in mauve_thread. --- debian/changelog | 6 ++++++ lib/mauve/http_server.rb | 4 ++++ lib/mauve/mauve_thread.rb | 4 ++++ lib/mauve/notifiers/sms_aql.rb | 5 +++-- lib/mauve/notifiers/templates/email.html.erb | 4 ++-- lib/mauve/notifiers/templates/email.txt.erb | 4 ++-- lib/mauve/notifiers/templates/xmpp.txt.erb | 2 +- 7 files changed, 22 insertions(+), 7 deletions(-) diff --git a/debian/changelog b/debian/changelog index bd352fc..ce62c76 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,3 +1,9 @@ +mauvealert (3.1.2) stable; urgency=low + + * Fixed up some gruesome spelling errors. + + -- Patrick J Cherry Tue, 19 Jul 2011 16:42:19 +0100 + mauvealert (3.1.1) stable; urgency=low * Fixed mauveserver config file searching diff --git a/lib/mauve/http_server.rb b/lib/mauve/http_server.rb index cb705ea..71261c8 100644 --- a/lib/mauve/http_server.rb +++ b/lib/mauve/http_server.rb @@ -8,6 +8,10 @@ require 'mauve/mauve_thread' require 'digest/sha1' require 'log4r' require 'thin' +# +# Needed for Lenny version of thin converted by apt-ruby, for some reason. +# +require 'thin_parser' require 'rack' require 'rack-flash' require 'rack/handler/webrick' diff --git a/lib/mauve/mauve_thread.rb b/lib/mauve/mauve_thread.rb index 55ec446..ca537da 100644 --- a/lib/mauve/mauve_thread.rb +++ b/lib/mauve/mauve_thread.rb @@ -50,6 +50,8 @@ module Mauve end def freeze + return if self.frozen? + logger.debug("Freezing") @frozen = true @@ -64,6 +66,8 @@ module Mauve end def thaw + return unless self.frozen? + logger.debug("Thawing") @frozen = false @thread.wakeup if @thread.stop? diff --git a/lib/mauve/notifiers/sms_aql.rb b/lib/mauve/notifiers/sms_aql.rb index d0cf630..9181be3 100644 --- a/lib/mauve/notifiers/sms_aql.rb +++ b/lib/mauve/notifiers/sms_aql.rb @@ -58,7 +58,7 @@ module Mauve template_file = File.join(File.dirname(__FILE__),"templates","sms.txt.erb") - txt += if File.exists?(template_file) + txt = if File.exists?(template_file) ERB.new(File.read(template_file)).result(binding).chomp else logger.error("Could not find sms.txt.erb template") @@ -74,7 +74,8 @@ module Mauve #txt += others.map { |alert| alert.summary_one_line }.join(", ") end - txt += "link: https://alert.bytemark.co.uk/alerts" + # TODO: Fix link to be accurate. + # txt += "link: https://alert.bytemark.co.uk/alerts" ## @TODO: Add a link to acknowledge the alert in the text? #txt += "Acknoweledge alert: "+ diff --git a/lib/mauve/notifiers/templates/email.html.erb b/lib/mauve/notifiers/templates/email.html.erb index 99f56d5..f0ce1be 100644 --- a/lib/mauve/notifiers/templates/email.html.erb +++ b/lib/mauve/notifiers/templates/email.html.erb @@ -19,9 +19,9 @@ end

Detail

<%= RedCloth.new(alert.detail).to_html %>

-<% if was_supressed and not is_suppressed %> +<% if was_suppressed and not is_suppressed %>

Better now. Your notifications have now restarted.

-<% elsif is_supressed and not was_suppressed %> +<% elsif is_suppressed and not was_suppressed %>

Too noisy! Your notifications have been suppressed.

<% end %>
--
Love mauve
xxx.
diff --git a/lib/mauve/notifiers/templates/email.txt.erb b/lib/mauve/notifiers/templates/email.txt.erb index a08ec55..dc5762b 100644 --- a/lib/mauve/notifiers/templates/email.txt.erb +++ b/lib/mauve/notifiers/templates/email.txt.erb @@ -19,9 +19,9 @@ end ----------------------------------------------------------------------- -<% if was_supressed and not is_suppressed +<% if was_suppressed and not is_suppressed %>Better now. Your notifications have now restarted.<% -elsif is_supressed and not was_suppressed +elsif is_suppressed and not was_suppressed %>Too noisy! Your notifications have been suppressed.<% end %> -- diff --git a/lib/mauve/notifiers/templates/xmpp.txt.erb b/lib/mauve/notifiers/templates/xmpp.txt.erb index d39500c..837fd67 100644 --- a/lib/mauve/notifiers/templates/xmpp.txt.erb +++ b/lib/mauve/notifiers/templates/xmpp.txt.erb @@ -15,6 +15,6 @@ end if was_suppressed and not is_suppressed %> Normal service has resumed.<% elsif is_suppressed and not was_suppressed -%> Further alerts supressed until things calm down.<% +%> Further alerts suppressed until things calm down.<% end %> -- cgit v1.2.1