~james-w/udd/management-commands

« back to all changes in this revision

Viewing changes to udd/scripts/requeue_package.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
from optparse import make_option, OptionParser
2
2
import sys
3
3
 
4
 
from udd import icommon
5
 
from udd.paths import paths
 
4
from udd import (
 
5
    icommon,
 
6
    iconfig,
 
7
    )
6
8
 
7
9
 
8
10
def get_options():
34
36
 
35
37
    opts.zap_revids = filter(None, opts.zap_revids.split(','))
36
38
 
37
 
    conn = icommon.get_sqlite_connection(paths.sqlite_file)
38
 
    db = icommon.StatusDatabase(paths.sqlite_file)
 
39
    conf = iconfig.ImporterStack()
 
40
    sqlite_file = conf.get('pi.sqlite_file')
 
41
    conn = icommon.get_sqlite_connection(sqlite_file)
 
42
    db = icommon.StatusDatabase(sqlite_file)
39
43
 
40
44
    for package in args:
41
 
        lock = icommon.lock_package(package)
 
45
        lock = icommon.lock_path(conf.get('pi.locks_dir'), package)
42
46
        if lock is None:
43
47
            print "Can't lock %s" % package
44
48
            errors += 1