summaryrefslogtreecommitdiff
path: root/kpov_judge/tasks/isc_dhcp_live_boot/task.py
diff options
context:
space:
mode:
authorTimotej Lazar <timotej.lazar@fri.uni-lj.si>2018-10-07 20:21:31 +0200
committerTimotej Lazar <timotej.lazar@fri.uni-lj.si>2018-10-07 20:21:31 +0200
commit80f050080ce11c6a0cce67c9b0281c09702b00d6 (patch)
treeb486e1f6342bc757dda87df4856084f652895791 /kpov_judge/tasks/isc_dhcp_live_boot/task.py
parent43d7ef057b4ae752a60b947e523b3a56782bf5cd (diff)
parentdbf585c2a59dbcb7f6d803d5756826b562cd7f43 (diff)
Merge branch 'fix-tasks'
Fixes pexpect usage in most tasks. Several other cleanups and minor refactoring.
Diffstat (limited to 'kpov_judge/tasks/isc_dhcp_live_boot/task.py')
-rw-r--r--kpov_judge/tasks/isc_dhcp_live_boot/task.py13
1 files changed, 5 insertions, 8 deletions
diff --git a/kpov_judge/tasks/isc_dhcp_live_boot/task.py b/kpov_judge/tasks/isc_dhcp_live_boot/task.py
index c5ac728..38bbcd8 100644
--- a/kpov_judge/tasks/isc_dhcp_live_boot/task.py
+++ b/kpov_judge/tasks/isc_dhcp_live_boot/task.py
@@ -1,8 +1,5 @@
-#!/usr/bin/env python
-# -*- coding: utf-8 -*-
-
# TODO: dokoncaj!
-# kpov_random_helpers should be imported by add_assignment.py
+# kpov_util should be imported by add_assignment.py
instructions = {
'si':"""
@@ -161,10 +158,10 @@ def task(IP_DHCP, IP_GW, MAC_BOOT, BOOT_FNAME):
def gen_params(user_id, params_meta):
params = dict()
r = random.Random(user_id)
- net = kpov_random_helpers.IPv4_subnet_gen(r, '10.64.0.0/10', 24)
- params['IP_DHCP'], params['IP_GW'] = kpov_random_helpers.IPv4_addr_gen(r, net, 2)
- params['BOOT_FNAME'] = kpov_random_helpers.fname_gen(r)
- params['TFTP_STRING'] = kpov_random_helpers.alnum_gen(r, 45)
+ net = kpov_util.IPv4_subnet_gen(r, '10.64.0.0/10', 24)
+ params['IP_DHCP'], params['IP_GW'] = kpov_util.IPv4_addr_gen(r, net, 2)
+ params['BOOT_FNAME'] = kpov_util.fname_gen(r)
+ params['TFTP_STRING'] = kpov_util.alnum_gen(r, 45)
# IP_NM, DNS_NM, IP_static, DNS_static)
return params