Bug 387181 - [RFE] [PATCH] yum-updatesd has boring email
Summary: [RFE] [PATCH] yum-updatesd has boring email
Keywords:
Status: CLOSED CURRENTRELEASE
Alias: None
Product: Fedora
Classification: Fedora
Component: yum-updatesd
Version: 8
Hardware: All
OS: Linux
medium
medium
Target Milestone: ---
Assignee: Jeremy Katz
QA Contact: Fedora Extras Quality Assurance
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2007-11-16 16:45 UTC by Pierre Ossman
Modified: 2008-06-02 11:44 UTC (History)
0 users

Fixed In Version: 0.9
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2008-06-02 11:44:22 UTC
Type: ---
Embargoed:


Attachments (Terms of Use)
more email.patch (3.04 KB, patch)
2007-11-16 21:16 UTC, Pierre Ossman
no flags Details | Diff

Description Pierre Ossman 2007-11-16 16:45:09 UTC
The email sent out by yum-updatesd is a bit boring and gives very little
information about what is going to be updated.

Suggested patch to get things a bit more exciting:

--- /usr/libexec/yum-updatesd-helper.orig       2007-11-16 17:06:15.000000000 +0100
+++ /usr/libexec/yum-updatesd-helper    2007-11-16 17:40:09.000000000 +0100
@@ -24,6 +24,8 @@
 import smtplib
 from optparse import OptionParser
 from email.MIMEText import MIMEText
+import socket
+import rfc822
 
 
 import yum
@@ -147,18 +149,30 @@
             return
 
         output = """
-        Hi,
-        There are %d package updates available. Please run the system
-        updater.
-        
-        Thank You,
-        Your Computer
-        """ % num
+Hi,
+This is the automatic update system on %s.
+
+There are %d package updates available. Please run the system
+updater.
+
+Packages available for update:
+
+""" % (socket.gethostname(), num)
+
+        for package in updateInfo:
+            output += "    %-30s %-10s\n" % (package[0]['name'],
package[0]['type'])
+
+        output += """
+
+Thank You,
+Your Computer
+"""
                 
         msg = MIMEText(output)
-        msg['Subject'] = "%d Updates Available" %(num,)
+        msg['Subject'] = "%d Updates Available on %s" %(num, socket.gethostname())
         msg['From'] = self.sender
         msg['To'] = self.rcpts
+        msg['Date'] = rfc822.formatdate()
         s = smtplib.SMTP()
         if self.smtp_server:
             s.connect(self.smtp_server)

Comment 1 Jeremy Katz 2007-11-16 17:11:38 UTC
Looks reasonable, but can you attach rather than cut and paste the patch so that
it doesn't get mangled by bugzilla?

Comment 2 Pierre Ossman 2007-11-16 21:16:49 UTC
Created attachment 261801 [details]
more email.patch

Looking a bit further at the code, I realised that it was lacking some central
functionality. So I increased the patch to also include email notification for
when yum-updatesd also installs the packets.

Comment 3 Jeremy Katz 2007-11-19 16:09:21 UTC
Applied.  Thanks for the patch!

Comment 4 Fedora Update System 2007-12-06 20:54:26 UTC
yum-updatesd-0.8-2.fc8 has been pushed to the Fedora 8 testing repository.  If problems still persist, please make note of it in this bug report.
 If you want to test the update, you can install it with 
 su -c 'yum --enablerepo=updates-testing update yum-updatesd'

Comment 5 Fedora Update System 2007-12-20 19:52:21 UTC
yum-updatesd-0.9-1.fc8 has been pushed to the Fedora 8 testing repository.  If problems still persist, please make note of it in this bug report.
 If you want to test the update, you can install it with 
 su -c 'yum --enablerepo=updates-testing update yum-updatesd'

Comment 6 Fedora Update System 2007-12-28 17:19:00 UTC
yum-updatesd-0.9-1.fc8 has been pushed to the Fedora 8 stable repository.  If problems still persist, please make note of it in this bug report.

Comment 7 Pierre Ossman 2008-06-02 06:04:50 UTC
Any special reason this bug is not closed? :)


Note You need to log in before you can comment on or make changes to this bug.