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

« back to all changes in this revision

Viewing changes to ivle/makeuser.py

  • Committer: Matt Giuca
  • Date: 2009-04-28 11:02:02 UTC
  • Revision ID: matt.giuca@gmail.com-20090428110202-pqr7ip8jpnqj199o
ivle.makeuser: mount_jail now requires a config argument
    (Though nobody ever seems to call this function...)

Show diffs side-by-side

added added

removed removed

Lines of Context:
295
295
                      % (username, unixid, unixid, username))
296
296
    passwd_file.close()
297
297
 
298
 
def mount_jail(login):
 
298
def mount_jail(login, config):
299
299
    # This is where we'll mount to...
300
 
    destdir = os.path.join(ivle.conf.jail_base, login)
 
300
    destdir = os.path.join(config['paths']['jails']['mounts'], login)
301
301
    # ... and this is where we'll get the user bits.
302
 
    srcdir = os.path.join(ivle.conf.jail_src_base, login)
 
302
    srcdir = os.path.join(config['paths']['jails']['src'], login)
303
303
    try:
304
304
        if not os.path.exists(destdir):
305
305
            os.mkdir(destdir)
306
306
        if os.system('/bin/mount -t aufs -o dirs=%s:%s=ro none %s'
307
 
                     % (srcdir, ivle.conf.jail_system, destdir)) == 0:
 
307
                     % (srcdir, config['paths']['jails']['template'],
 
308
                        destdir)) == 0:
308
309
            logging.info("mounted user %s's jail." % login)
309
310
        else:
310
311
            logging.error("failed to mount user %s's jail!" % login)