Package: mini-dinstall
Version: 0.6.22+psha0
Severity: wishlist
Tags: patch
Mail sent by mini-dinstall on success has subject
"mini-dinstall success notice" which is not informative.
Suggested patch adds first line of log message into subject.
Both git and plain patches are attached.
-- System Information:
Debian Release: lenny/sid
APT prefers unstable
APT policy: (500, 'unstable'), (500, 'stable'), (1, 'experimental')
Architecture: i386 (i686)
Kernel: Linux 2.6.22-2-686 (SMP w/2 CPU cores)
Locale: LANG=ru_RU.UTF-8, LC_CTYPE=ru_RU.UTF-8 (charmap=UTF-8) (ignored: LC_ALL
set to ru_RU.UTF-8)
Shell: /bin/sh linked to /bin/bash
Versions of packages mini-dinstall depends on:
ii apt-utils 0.7.9 APT utility programs
ii python 2.4.4-6 An interactive high-level object-o
ii python-apt 0.7.3.1+b1 Python interface to libapt-pkg
ii python-support 0.7.5 automated rebuilding support for p
mini-dinstall recommends no packages.
-- no debconf information
commit 455fb0c8464a8619ff65276c9f44f55c17eda3ec
Author: Pavel Shramov <[EMAIL PROTECTED]>
Date: Thu Nov 15 21:28:57 2007 +0300
added %m to subject (success_logger)
diff --git a/mini-dinstall b/mini-dinstall
index 0a871d9..5a28884 100755
--- a/mini-dinstall
+++ b/mini-dinstall
@@ -195,7 +195,7 @@ class SubjectSpecifyingLoggingSMTPHandler(logging.handlers.SMTPHandler):
apply(logging.handlers.SMTPHandler.__init__, [self] + list(args) + ['dummy'], kwargs)
def getSubject(self, record):
- return re.sub('%l', record.levelname, self._subject)
+ return self._subject.replace('%l', record.levelname).replace('%m', record.msg.split('\n')[0])
if not (configp.has_option('DEFAULT', 'mail_log_level') and configp.get('DEFAULT', 'mail_log_level') == 'NONE'):
if configp.has_option('DEFAULT', 'mail_log_level'):
@@ -707,7 +707,7 @@ class ArchiveDir:
if self._mail_on_success:
self._success_logger = logging.Logger("mini-dinstall." + self._name)
self._success_logger.setLevel(logging.DEBUG)
- handler = SubjectSpecifyingLoggingSMTPHandler('mini-dinstall success notice', mail_server, 'Mini-Dinstall <[EMAIL PROTECTED]>' % (getpass.getuser(),socket.getfqdn()), [mail_to])
+ handler = SubjectSpecifyingLoggingSMTPHandler('mini-dinstall: %m', mail_server, 'Mini-Dinstall <[EMAIL PROTECTED]>' % (getpass.getuser(),socket.getfqdn()), [mail_to])
handler.setLevel(logging.DEBUG)
self._success_logger.addHandler(handler)
self._clean_targets = []
>From 455fb0c8464a8619ff65276c9f44f55c17eda3ec Mon Sep 17 00:00:00 2001
From: Pavel Shramov <[EMAIL PROTECTED]>
Date: Thu, 15 Nov 2007 21:28:57 +0300
Subject: [PATCH] added %m to subject (success_logger)
---
mini-dinstall | 4 ++--
1 files changed, 2 insertions(+), 2 deletions(-)
diff --git a/mini-dinstall b/mini-dinstall
index 0a871d9..5a28884 100755
--- a/mini-dinstall
+++ b/mini-dinstall
@@ -195,7 +195,7 @@ class SubjectSpecifyingLoggingSMTPHandler(logging.handlers.SMTPHandler):
apply(logging.handlers.SMTPHandler.__init__, [self] + list(args) + ['dummy'], kwargs)
def getSubject(self, record):
- return re.sub('%l', record.levelname, self._subject)
+ return self._subject.replace('%l', record.levelname).replace('%m', record.msg.split('\n')[0])
if not (configp.has_option('DEFAULT', 'mail_log_level') and configp.get('DEFAULT', 'mail_log_level') == 'NONE'):
if configp.has_option('DEFAULT', 'mail_log_level'):
@@ -707,7 +707,7 @@ class ArchiveDir:
if self._mail_on_success:
self._success_logger = logging.Logger("mini-dinstall." + self._name)
self._success_logger.setLevel(logging.DEBUG)
- handler = SubjectSpecifyingLoggingSMTPHandler('mini-dinstall success notice', mail_server, 'Mini-Dinstall <[EMAIL PROTECTED]>' % (getpass.getuser(),socket.getfqdn()), [mail_to])
+ handler = SubjectSpecifyingLoggingSMTPHandler('mini-dinstall: %m', mail_server, 'Mini-Dinstall <[EMAIL PROTECTED]>' % (getpass.getuser(),socket.getfqdn()), [mail_to])
handler.setLevel(logging.DEBUG)
self._success_logger.addHandler(handler)
self._clean_targets = []
--
1.5.3.5