~launchpad-pqm/launchpad/devel

« back to all changes in this revision

Viewing changes to lib/lp/services/mailman/monkeypatches/xmlrpcrunner.py

  • Committer: Launchpad Patch Queue Manager
  • Date: 2012-01-01 02:41:30 UTC
  • mfrom: (14612.1.3 mailman-tests-unbitrot)
  • Revision ID: launchpad@pqm.canonical.com-20120101024130-8jz8mbz8kfrufcnz
[r=wgrant][no-qa] Unbitrot mailman OOPS handling and tests.

Show diffs side-by-side

added added

removed removed

Lines of Context:
57
57
        mm_cfg.XMLRPC_URL, transport=Transport(timeout=mm_cfg.XMLRPC_TIMEOUT))
58
58
 
59
59
 
60
 
class MailmanErrorUtility(ErrorReportingUtility):
61
 
    """An error utility that for the MailMan xmlrpc process."""
62
 
 
63
 
    _default_config_section = 'mailman'
64
 
 
65
 
 
66
60
def log_exception(message, *args):
67
61
    """Write the current exception traceback into the Mailman log file.
68
62
 
73
67
        may be a format string.
74
68
    :param args: Optional arguments to be interpolated into a format string.
75
69
    """
76
 
    error_utility = MailmanErrorUtility()
 
70
    error_utility = ErrorReportingUtility()
 
71
    error_utility.configure(section_name='mailman')
77
72
    error_utility.raising(sys.exc_info())
78
73
    out_file = StringIO()
79
74
    traceback.print_exc(file=out_file)
169
164
    def _log(self, exc):
170
165
        """Log the exception in a log file and as an OOPS."""
171
166
        Runner._log(self, exc)
172
 
        error_utility = MailmanErrorUtility()
 
167
        error_utility = ErrorReportingUtility()
 
168
        error_utility.configure(section_name='mailman')
173
169
        error_utility.raising(sys.exc_info())
174
170
 
175
171
    def _check_list_actions(self):