Apply partial fix for upstream #9167

Tagmail report sends email when nothing happens.  This is a partial fix
because it doesn't handle --noop mode.
epel9
Todd Zullinger 13 years ago
parent 65b5b66a83
commit 47fcf33655

@ -0,0 +1,46 @@
From e8c0c799e6f648a90028ce2248e14247f021f1c7 Mon Sep 17 00:00:00 2001
From: Kelsey Hightower <kelsey.hightower@gmail.com>
Date: Wed, 24 Aug 2011 21:51:45 -0400
Subject: [PATCH/puppet] (#9167) Do not sent tagmail reports if no changes
Prevent Puppet Master from sending tagmail reports if the status of the
puppet run is "unchanged".
---
lib/puppet/reports/tagmail.rb | 6 ++++++
spec/unit/reports/tagmail_spec.rb | 5 +++++
2 files changed, 11 insertions(+), 0 deletions(-)
diff --git a/lib/puppet/reports/tagmail.rb b/lib/puppet/reports/tagmail.rb
index c37341e..cf33cfa 100644
--- a/lib/puppet/reports/tagmail.rb
+++ b/lib/puppet/reports/tagmail.rb
@@ -108,6 +108,12 @@ Puppet::Reports.register_report(:tagmail) do
# Process the report. This just calls the other associated messages.
def process
+ # Do not send the email report if nothing changed.
+ if self.status == "unchanged"
+ Puppet.info "Not sending tagmail report; no changes"
+ return
+ end
+
unless FileTest.exists?(Puppet[:tagmap])
Puppet.notice "Cannot send tagmail report; no tagmap file #{Puppet[:tagmap]}"
return
diff --git a/spec/unit/reports/tagmail_spec.rb b/spec/unit/reports/tagmail_spec.rb
index a53d119..0df67ec 100755
--- a/spec/unit/reports/tagmail_spec.rb
+++ b/spec/unit/reports/tagmail_spec.rb
@@ -88,4 +88,9 @@ describe tagmail do
results.should be_nil
end
end
+
+ describe "when there are no changes" do
+ it "should not send an email"
+ end
+
end
--
1.7.6

@ -14,6 +14,8 @@ Source0: http://downloads.puppetlabs.com/%{name}/%{name}-%{version}.tar.g
Source1: http://downloads.puppetlabs.com/%{name}/%{name}-%{version}.tar.gz.asc Source1: http://downloads.puppetlabs.com/%{name}/%{name}-%{version}.tar.gz.asc
# https://projects.puppetlabs.com/issues/10244 # https://projects.puppetlabs.com/issues/10244
Patch0: 0001-10244-Restore-Mongrel-XMLRPC-functionality.patch Patch0: 0001-10244-Restore-Mongrel-XMLRPC-functionality.patch
# https://projects.puppetlabs.com/issues/9167
Patch1: 0001-9167-Do-not-sent-tagmail-reports-if-no-changes.patch
Group: System Environment/Base Group: System Environment/Base
@ -69,6 +71,7 @@ The server can also function as a certificate authority and file server.
%prep %prep
%setup -q %setup -q
%patch0 -p1 %patch0 -p1
%patch1 -p1
patch -s -p1 < conf/redhat/rundir-perms.patch patch -s -p1 < conf/redhat/rundir-perms.patch
%build %build
@ -258,6 +261,8 @@ rm -rf %{buildroot}
* Sun Oct 23 2011 Todd Zullinger <tmz@pobox.com> - 2.6.12-1 * Sun Oct 23 2011 Todd Zullinger <tmz@pobox.com> - 2.6.12-1
- Update to 2.6.12, fixes CVE-2011-3872 - Update to 2.6.12, fixes CVE-2011-3872
- Add upstream patch to restore Mongrel XMLRPC functionality (upstream #10244) - Add upstream patch to restore Mongrel XMLRPC functionality (upstream #10244)
- Apply partial fix for upstream #9167 (tagmail report sends email when nothing
happens)
* Thu Sep 29 2011 Todd Zullinger <tmz@pobox.com> - 2.6.6-3 * Thu Sep 29 2011 Todd Zullinger <tmz@pobox.com> - 2.6.6-3
- Apply upstream patches for CVE-2011-3869, CVE-2011-3870, CVE-2011-3871, and - Apply upstream patches for CVE-2011-3869, CVE-2011-3870, CVE-2011-3871, and

Loading…
Cancel
Save