summaryrefslogtreecommitdiff
path: root/kpov_judge
diff options
context:
space:
mode:
authorTimotej Lazar <timotej.lazar@fri.uni-lj.si>2019-02-12 18:42:14 +0100
committerTimotej Lazar <timotej.lazar@fri.uni-lj.si>2019-02-12 18:42:14 +0100
commitdd9eaef3b467ffe1693ceeee4a0398d191945faf (patch)
tree63e4e1a60a24271f1b1ba1b2d5a5e657d640d10c /kpov_judge
parent97e13d167e5ccdc02e2c1ac34b9179cbe316db14 (diff)
create_disk_images: add diskless computers to db.student_computers
Using defaultdict for all_disks resulted in diskless computers missing from DB. By iterating over keys in computers instead of all_disks computers with no disk are also added (and later shown on task page).
Diffstat (limited to 'kpov_judge')
-rwxr-xr-xkpov_judge/create_disk_images.py4
1 files changed, 3 insertions, 1 deletions
diff --git a/kpov_judge/create_disk_images.py b/kpov_judge/create_disk_images.py
index 5e630be..ce79f85 100755
--- a/kpov_judge/create_disk_images.py
+++ b/kpov_judge/create_disk_images.py
@@ -178,7 +178,9 @@ if __name__ == '__main__':
g.close()
lock_fp.write("saving URLs\n")
- for comp_name, disks in all_disks.items():
+ for computer in computers:
+ comp_name = computer['name']
+ disks = all_disks[comp_name]
lock_fp.write('urls: '+ str(disks) + '\n')
l = db.student_computers.update({
'disk_urls': {'$exists': False},