From c80f2905d6da532e41f1b217de10e387e3b6e76e Mon Sep 17 00:00:00 2001 From: "gasperfele@fri1.uni-lj.si" Date: Sun, 2 Oct 2016 08:22:56 +0000 Subject: write_default_config now also pre-sets the username git-svn-id: https://svn.lusy.fri.uni-lj.si/kpov-public-svn/kpov-public@354 5cf9fbd1-b2bc-434c-b4b7-e852f4f63414 --- kpov_judge/util.py | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/kpov_judge/util.py b/kpov_judge/util.py index 66e2707..f92c7c9 100644 --- a/kpov_judge/util.py +++ b/kpov_judge/util.py @@ -1,10 +1,12 @@ import yaml -def write_default_config(disk, params): +def write_default_config(disk, global_params): default_params = dict() for k in [ 'task_name', + 'username', 'task_url']: - if k in params: - default_params[k] = params[k] + if k in global_params: + default_params[k] = global_params[k] disk.write('/home/tester/.kpov_params.yaml', yaml.dump(default_params)) + disk.chown(1001, 1001, "/home/tester/.kpov_params.yaml") -- cgit v1.2.1