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

« back to all changes in this revision

Viewing changes to bin/ivle-mountallusers

  • Committer: me at id
  • Date: 2009-01-15 00:37:10 UTC
  • mto: This revision was merged to the branch mainline in revision 1090.
  • Revision ID: svn-v3-trunk0:2b9c9e99-6f39-0410-b283-7f802c844ae2:branches%2Fstorm:1141
ivle.database.User: Add an authenticate() method, and a hash_password()
     staticmethod to replace the auth functions in ivle.db.

Show diffs side-by-side

added added

removed removed

Lines of Context:
29
29
import optparse
30
30
import logging
31
31
 
32
 
import ivle.database
 
32
import ivle.db
33
33
import ivle.conf
34
34
 
35
35
p = optparse.OptionParser()
49
49
                          os.path.basename(sys.argv[0])
50
50
    sys.exit(1)
51
51
 
52
 
store = ivle.database.get_store()
53
 
users = store.find(ivle.database.User).order_by(ivle.database.User.login)
 
52
try:
 
53
    db = ivle.db.DB()
 
54
    list = db.get_users()
 
55
    res = db.get_all('login', ['login', 'unixid'])
 
56
    def repack(flds):
 
57
        return (flds['login'], flds['unixid'])
 
58
    uids = dict(map(repack,res))
 
59
except Exception, message:
 
60
    logging.error(str(message))
 
61
    sys.exit(1)
54
62
 
55
63
logging.info("mass aufs mount started")
56
64
 
57
 
for user in users:
 
65
list.sort(key=lambda user: user.login)
 
66
for user in list:
58
67
    login = user.login
59
68
    # This is where we'll mount to...
60
69
    destdir = os.path.join(ivle.conf.jail_base, login)