Bug 387181 - [RFE] [PATCH] yum-updatesd has boring email
[RFE] [PATCH] yum-updatesd has boring email
Status: CLOSED CURRENTRELEASE
Product: Fedora
Classification: Fedora
Component: yum-updatesd (Show other bugs)
8
All Linux
medium Severity medium
: ---
: ---
Assigned To: Jeremy Katz
Fedora Extras Quality Assurance
:
Depends On:
Blocks:
  Show dependency treegraph
 
Reported: 2007-11-16 11:45 EST by Pierre Ossman
Modified: 2008-06-02 07:44 EDT (History)
0 users

See Also:
Fixed In Version: 0.9
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 2008-06-02 07:44:22 EDT
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---


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

  None (edit)
Description Pierre Ossman 2007-11-16 11:45:09 EST
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 12:11:38 EST
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 16:16:49 EST
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 11:09:21 EST
Applied.  Thanks for the patch!
Comment 4 Fedora Update System 2007-12-06 15:54:26 EST
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 14:52:21 EST
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 12:19:00 EST
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 02:04:50 EDT
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.