Changeset 355 for cleverbox/trunk

Show
Ignore:
Timestamp:
07/13/09 13:07:27 (13 months ago)
Author:
trivoallan
Message:

Fixed SVN permission issues.

Location:
cleverbox/trunk/cleverbox
Files:
2 modified

Legend:

Unmodified
Added
Removed
  • cleverbox/trunk/cleverbox/model/project.py

    r354 r355  
    278278        os.path.join(environment.get_path(), 'projects-available', client_name + '-' + project_name)   : (0640, 'root', 'root'), 
    279279        os.path.join(clients_root, client_name, 'htdocs', project_name)                                : (0770, 'root', 'www-data'), 
    280         os.path.join(clients_root, client_name, 'var', 'svn', project_name)                            : (0750, 'root', 'www-data'), 
    281         os.path.join(clients_root, client_name, 'var', 'svn', project_name, 'db')                      : (0770, 'root', 'www-data'), 
     280        os.path.join(clients_root, client_name, 'var', 'svn', project_name)                            : (0770, 'root', 'www-data'), 
    282281        os.path.join(clients_root, client_name, 'var', 'trac', project_name)                           : (0770, 'root', 'www-data'), 
    283282        os.path.join(clients_root, client_name, 'var', 'trac', project_name, 'db')                     : (0770, 'root', 'www-data'), 
    284283        os.path.join(clients_root, client_name, 'var', 'trac', project_name, 'db', 'trac.db')          : (0770, 'root', 'www-data'), 
    285284        os.path.join(clients_root, client_name, 'var', 'trac', project_name, 'attachments')            : (0770, 'root', 'www-data'), 
    286         os.path.join(clients_root, client_name, 'var', 'trac', project_name, 'conf', 'trac.ini')       : (0640, 'root', 'www-data'), 
     285        os.path.join(clients_root, client_name, 'var', 'trac', project_name, 'conf', 'trac.ini')       : (0660, 'root', 'www-data'), 
    287286    } 
    288287 
    289288    filesystem.set_permissions(permissions) 
     289 
     290    # Since filesystem.set_permissions does not handle recursion, svn/db dir is modified is done manually 
     291    filesystem.chowntree( 
     292        os.path.join(clients_root, client_name, 'var', 'svn', project_name, 'db'),  
     293        filesystem.get_uid_from_name('root'),  
     294        filesystem.get_gid_from_name('www-data') 
     295    ) 
     296    os.path.walk(os.path.join(clients_root, client_name, 'var', 'svn', project_name, 'db'), filesystem.chmodtree, 0770)  
    290297 
    291298    print "  Perms fixed\n" 
  • cleverbox/trunk/cleverbox/utils/filesystem.py

    r260 r355  
    4343        print "rchown %s: %s" % (str(directory), str(why)) 
    4444 
     45def chmodtree(arg, dirname, fnames): 
     46    """ To be used with os.path.walk. """ 
     47 
     48    os.chmod(dirname, arg) 
     49    for file in fnames: 
     50        os.chmod(os.path.join(dirname, file), arg) 
     51 
     52 
    4553def get_uid_from_name(username): 
    4654    """