[yum-commits] yum-cron/yum-cron.py

zpavlas at osuosl.org zpavlas at osuosl.org
Tue Dec 10 07:48:54 UTC 2013


 yum-cron/yum-cron.py |    6 ++++++
 1 file changed, 6 insertions(+)

New commits:
commit e1db5d6a94dee861d1fa0552277bc03f037c6e3a
Author: Zdenek Pavlas <zpavlas at redhat.com>
Date:   Tue Dec 10 08:47:48 2013 +0100

    yum-cron: stderr/email: no output if no messages

diff --git a/yum-cron/yum-cron.py b/yum-cron/yum-cron.py
index dd0a4c6..f53fbfb 100755
--- a/yum-cron/yum-cron.py
+++ b/yum-cron/yum-cron.py
@@ -685,6 +685,9 @@ class EmailEmitter(UpdateEmitter):
         """Combine the stored messages that have been stored into a
         single email message, and send this message.
         """
+        # Don't send empty emails
+        if not self.output:
+            return
         # Build up the email to be sent
         msg = MIMEText(''.join(self.output))
         msg['Subject'] = self.subject
@@ -708,6 +711,9 @@ class StdIOEmitter(UpdateEmitter):
         """Combine the stored messages that have been stored into a
         single email message, and send this message to standard output.
         """
+        # Don't print blank lines
+        if not self.output:
+            return
         print "".join(self.output)
 
 


More information about the Yum-commits mailing list