~james-w/udd/management-commands

« back to all changes in this revision

Viewing changes to udd/scripts/show_failure.py

  • Committer: James Westby
  • Date: 2011-12-13 21:09:23 UTC
  • mfrom: (557.1.1 drop_email_failures)
  • Revision ID: james.westby@canonical.com-20111213210923-tfrirlx3xbwmi70u
Merged drop_email_failures into management-commands.

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
1
import sys
2
2
 
3
 
from udd import icommon
4
 
from udd.paths import paths
 
3
from udd import (
 
4
    icommon,
 
5
    iconfig,
 
6
    )
5
7
 
6
8
 
7
9
def print_reason(package):
8
 
    db = icommon.StatusDatabase(paths.sqlite_file)
 
10
    conf = iconfig.ImporterStack()
 
11
    db = icommon.StatusDatabase(conf.get('pi.sqlite_file'))
9
12
    reason = db.failure_reason(package)
10
13
    if reason is None:
11
14
        print "%s has not failed" % (package,)