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

« back to all changes in this revision

Viewing changes to lib/common/makeuser.py

  • Committer: dcoles
  • Date: 2008-08-25 00:31:00 UTC
  • Revision ID: svn-v3-trunk0:2b9c9e99-6f39-0410-b283-7f802c844ae2:trunk:1040
Console: Fixed the 'reset' button. Console service should call 'terminate' 
rather than 'restart'

Show diffs side-by-side

added added

removed removed

Lines of Context:
65
65
    try:
66
66
        res = os.system("svnadmin create '%s'" % path)
67
67
        if res != 0 and throw_on_error:
68
 
            raise Exception("Cannot create repository for %s" % login)
 
68
            raise Exception("Cannot create repository: %s" % path)
69
69
    except Exception, exc:
70
70
        print repr(exc)
71
71
        if throw_on_error:
103
103
    os.rename(conf.svn_conf + ".new", conf.svn_conf)
104
104
    chown_to_webserver(conf.svn_conf)
105
105
 
 
106
def rebuild_svn_group_config():
 
107
    """Build the complete SVN configuration file for groups
 
108
    """
 
109
    conn = db.DB()
 
110
    groups = conn.get_all('project_group',
 
111
        ['groupid', 'groupnm', 'projectsetid'])
 
112
    f = open(conf.svn_group_conf + ".new", "w")
 
113
    f.write("# IVLE SVN Group Repositories Configuration\n")
 
114
    f.write("# Auto-generated on %s\n" % time.asctime())
 
115
    f.write("\n")
 
116
    for g in groups:
 
117
        projectsetid = g['projectsetid']
 
118
        offeringinfo = conn.get_offering_info(projectsetid)
 
119
        subj_short_name = offeringinfo['subj_short_name']
 
120
        year = offeringinfo['year']
 
121
        semester = offeringinfo['semester']
 
122
        reponame = "_".join([subj_short_name, year, semester, g['groupnm']])
 
123
        f.write("[%s:/]\n"%reponame)
 
124
        users = conn.get_projectgroup_members(g['groupid'])
 
125
        for u in users:
 
126
            f.write("%s = rw\n"%u['login'])
 
127
        f.write("\n")
 
128
    f.close()
 
129
    os.rename(conf.svn_group_conf + ".new", conf.svn_group_conf)
 
130
    chown_to_webserver(conf.svn_group_conf)
 
131
 
106
132
def make_svn_auth(login, throw_on_error=True):
107
133
    """Setup svn authentication for the given user.
108
134
       FIXME: create local.auth entry