diff options
author | Timotej Lazar <timotej.lazar@fri.uni-lj.si> | 2019-02-12 18:42:14 +0100 |
---|---|---|
committer | Timotej Lazar <timotej.lazar@fri.uni-lj.si> | 2019-02-12 18:42:14 +0100 |
commit | dd9eaef3b467ffe1693ceeee4a0398d191945faf (patch) | |
tree | 63e4e1a60a24271f1b1ba1b2d5a5e657d640d10c /kpov_judge | |
parent | 97e13d167e5ccdc02e2c1ac34b9179cbe316db14 (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-x | kpov_judge/create_disk_images.py | 4 |
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}, |