~azzar1/unity/add-show-desktop-key

« back to all changes in this revision

Viewing changes to bin/ivle-remakeuser

  • Committer: Matt Giuca
  • Date: 2010-07-22 03:57:16 UTC
  • mto: This revision was merged to the branch mainline in revision 1820.
  • Revision ID: matt.giuca@gmail.com-20100722035716-7p5t3c349lqwasqk
Database: Modified project_extension table; replaced 'deadline TIMESTAMP' with 'days INT'. This means the extension is a time delta on top of the existing deadline, not a replacement deadline.
Added a migration (userdb/migrations/20100722-01.sql) and updated ivle.database.

Show diffs side-by-side

added added

removed removed

Lines of Context:
28
28
import os
29
29
import optparse
30
30
import logging
 
31
import traceback
31
32
 
 
33
import ivle.config
32
34
import ivle.database
33
35
import ivle.makeuser
34
36
 
48
50
                          os.path.basename(sys.argv[0])
49
51
    sys.exit(1)
50
52
 
51
 
store = ivle.database.get_store()
 
53
config = ivle.config.Config()
 
54
store = ivle.database.get_store(config)
52
55
 
53
56
if options.all:
54
57
    users = store.find(ivle.database.User).order_by(ivle.database.User.login)
62
65
 
63
66
for user in users:
64
67
    try:
65
 
        ivle.makeuser.make_jail(user)
 
68
        ivle.makeuser.make_jail(user, config)
66
69
    except Exception, message:
67
 
        logging.warning(str(message))
 
70
        logging.error("Failed to recreate jail for %s.\n%s" % 
 
71
                      (user.login, traceback.format_exc()))
68
72
        continue
69
73
 
70
74
    logging.debug("recreated user %s's jail." % user.login)