~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:15 UTC
  • mfrom: (555.1.1 drop-cricket)
  • mto: This revision was merged to the branch mainline in revision 560.
  • Revision ID: james.westby@canonical.com-20111213210915-mfx5hktfoivb94hk
Merge trunk.

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
1
from optparse import 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():
36
38
 
37
39
    opts.zap_revids = filter(None, opts.zap_revids.split(','))
38
40
 
39
 
    conn = icommon.get_sqlite_connection(paths.sqlite_file)
40
 
    db = icommon.StatusDatabase(paths.sqlite_file)
 
41
    conf = iconfig.ImporterStack()
 
42
    sqlite_file = conf.get('pi.sqlite_file')
 
43
    conn = icommon.get_sqlite_connection(sqlite_file)
 
44
    db = icommon.StatusDatabase(sqlite_file)
41
45
 
42
46
    for package in args:
43
 
        lock = icommon.lock_package(package)
 
47
        lock = icommon.lock_path(conf.get('pi.locks_dir'), package)
44
48
        if lock is None:
45
49
            print "Can't lock %s" % package
46
50
            errors += 1