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

« back to all changes in this revision

Viewing changes to bin/ivle-remakeuser

  • Committer: David Coles
  • Date: 2009-08-13 21:28:32 UTC
  • mto: This revision was merged to the branch mainline in revision 1318.
  • Revision ID: coles.david@gmail.com-20090813212832-o3dq367fwa0d2y75
Set project.deadline to NOT NULL since it is required for submits.

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)