177
177
cf.write("svn_pass = %s\n" % repr(passwd))
182
logging.debug("Checking out directories in the jail")
184
svn.checkout(conf.svn_addr + login + "/stuff",
185
common.studpath.url_to_local(login + "/stuff")[1])
186
except Exception, exc:
187
logging.warning("While mkdiring stuff: %s" % str(exc))
190
svn.checkout(conf.svn_addr + login + "/info1",
191
common.studpath.url_to_local(login + "/info1")[1])
192
except Exception, exc:
193
logging.warning("While mkdiring info1: %s" % str(exc))
180
# Check out the repositories into the student's home dir
196
183
# FIXME: should this be nicer?
197
184
os.system("chown -R %d:%d %s" \
197
def do_checkout(props):
198
"""Create the default contents of a user's jail by checking out from the
200
If any directory already exists, just fail silently (so this is not a
201
"wipe-and-checkout", merely a checkout if it failed or something).
203
login - the user name for the jail
208
login = props['login']
212
logging.debug("Checking out directories in the jail")
214
svn.checkout(conf.svn_addr + login + "/stuff",
215
common.studpath.url_to_local(login + "/stuff")[1])
216
os.system("chown -R %d:%d %s" \
217
% (details.unixid, details.unixid,
218
common.studpath.url_to_local(login + "/stuff")[1]))
219
except Exception, exc:
220
logging.warning("While mkdiring stuff: %s" % str(exc))
223
svn.checkout(conf.svn_addr + login + "/info1",
224
common.studpath.url_to_local(login + "/info1")[1])
225
os.system("chown -R %d:%d %s" \
226
% (details.unixid, details.unixid,
227
common.studpath.url_to_local(login + "/info1")[1]))
228
except Exception, exc:
229
logging.warning("While mkdiring info1: %s" % str(exc))
232
return {"response": "okay"}
211
235
'create_user':create_user,
212
236
'update_user':update_user,
213
237
'activate_user':activate_user,
238
'do_checkout':do_checkout,
216
241
def dispatch(props):