Login
[x]
Log in using an account from:
Fedora Account System
Red Hat Associate
Red Hat Customer
Or login using a Red Hat Bugzilla account
Forgot Password
Login:
Hide Forgot
Create an Account
Red Hat Bugzilla – Attachment 261801 Details for
Bug 387181
[RFE] [PATCH] yum-updatesd has boring email
[?]
New
Simple Search
Advanced Search
My Links
Browse
Requests
Reports
Current State
Search
Tabular reports
Graphical reports
Duplicates
Other Reports
User Changes
Plotly Reports
Bug Status
Bug Severity
Non-Defaults
|
Product Dashboard
Help
Page Help!
Bug Writing Guidelines
What's new
Browser Support Policy
5.0.4.rh83 Release notes
FAQ
Guides index
User guide
Web Services
Contact
Legal
This site requires JavaScript to be enabled to function correctly, please enable it.
[patch]
more email.patch
yum.patch (text/plain), 3.04 KB, created by
Pierre Ossman
on 2007-11-16 21:16:49 UTC
(
hide
)
Description:
more email.patch
Filename:
MIME Type:
Creator:
Pierre Ossman
Created:
2007-11-16 21:16:49 UTC
Size:
3.04 KB
patch
obsolete
>--- yum-updatesd-helper.orig 2007-11-16 17:06:15.000000000 +0100 >+++ yum-updatesd-helper 2007-11-16 22:08:06.000000000 +0100 >@@ -24,6 +24,8 @@ > import smtplib > from optparse import OptionParser > from email.MIMEText import MIMEText >+import socket >+import rfc822 > > > import yum >@@ -141,24 +143,33 @@ > self.rcpts = rcpts > self.smtp_server = smtp_server > >- def updatesAvailable(self, updateInfo): >- num = len(updateInfo) >- if num < 1: >- return >+ def _msgGreeting(self): >+ output = """Hi, >+This is the automatic update system on %s. >+ >+""" % socket.gethostname() >+ return output > >+ def _msgFooter(self): > output = """ >- Hi, >- There are %d package updates available. Please run the system >- updater. >- >- Thank You, >- Your Computer >- """ % num >- >- msg = MIMEText(output) >- msg['Subject'] = "%d Updates Available" %(num,) >+Thank You, >+Your Computer >+""" >+ return output >+ >+ def _msgPacketList(self, updateInfo): >+ output = "" >+ for package in updateInfo: >+ output += " %-30s %-10s\n" % (package[0]['name'], package[0]['type']) >+ return output >+ >+ def _sendMessage(self, subject, body): >+ msg = MIMEText(body) >+ msg['Subject'] = "yum: %s (on %s) " % (subject, 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) >@@ -167,6 +178,56 @@ > s.sendmail(self.sender, self.rcpts.split(','), msg.as_string()) > s.close() > >+ def updatesAvailable(self, updateInfo): >+ num = len(updateInfo) >+ if num < 1: >+ return >+ >+ output = self._msgGreeting() >+ >+ output += """There are %d package updates available. Please run the system updater. >+ >+Packages available for update: >+ >+""" % num >+ >+ output += self._msgPacketList(updateInfo) >+ output += self._msgFooter() >+ >+ self._sendMessage("%d Updates Available" % num, output) >+ >+ def updatesApplied(self, updateInfo): >+ num = len(updateInfo) >+ if num < 1: >+ return >+ >+ output = self._msgGreeting() >+ >+ output += """The system successfully installed/updated %d packages. >+ >+Packages installed or updated: >+ >+""" % num >+ >+ output += self._msgPacketList(updateInfo) >+ output += self._msgFooter() >+ >+ self._sendMessage("%d packets installed/updated" % num, output) >+ >+ def updatesFailed(self, errmsgs): >+ output = self._msgGreeting() >+ >+ output += """There was a problem updating the system. The following error message >+was reported: >+ >+%s >+ >+If the problem persists, manual intervention may be required.""" % errmsgs >+ >+ output += self._msgFooter() >+ >+ self._sendMessage("problem updating system", output) >+ > class DbusUpdateEmitter(UpdateEmitter): > def __init__(self): > UpdateEmitter.__init__(self)
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
Attachments on
bug 387181
: 261801