From 9c51bbe5016495c714789f5df01806a6d366e11a Mon Sep 17 00:00:00 2001 From: Timotej Lazar Date: Sat, 6 Oct 2018 23:56:03 +0200 Subject: Rename kpov_random_helpers to kpov_util --- kpov_judge/tasks/openwrt/task.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'kpov_judge/tasks/openwrt') diff --git a/kpov_judge/tasks/openwrt/task.py b/kpov_judge/tasks/openwrt/task.py index 057fb96..b55905c 100644 --- a/kpov_judge/tasks/openwrt/task.py +++ b/kpov_judge/tasks/openwrt/task.py @@ -1,7 +1,7 @@ #!/usr/bin/env python # -*- coding: utf-8 -*- -# kpov_random_helpers should be imported by add_assignment.py +# kpov_util should be imported by add_assignment.py instructions = { 'si':""" @@ -94,9 +94,9 @@ def gen_params(user_id, params_meta): r = random.Random(user_id) # IP_NM, DNS_NM, IP_static, DNS_static) dns_servers = ['193.2.1.66', '193.2.1.72', '8.8.8.8', '8.8.4.4', '208.67.222.222', '208.67.220.220'] - net = kpov_random_helpers.IPv4_subnet_gen(r, '172.23.128.0/18', 24) + net = kpov_util.IPv4_subnet_gen(r, '172.23.128.0/18', 24) params['DNS_NM'] = r.choice(dns_servers) - params['IP_NM'], params['IP_static'] = kpov_random_helpers.IPv4_addr_gen(r, net, 2) + params['IP_NM'], params['IP_static'] = kpov_util.IPv4_addr_gen(r, net, 2) params['DNS_static'] = r.choice(dns_servers) return params -- cgit v1.2.1 From b5b35faea7f4205f353f57178ddc795b7dce5043 Mon Sep 17 00:00:00 2001 From: Timotej Lazar Date: Sun, 7 Oct 2018 19:02:26 +0200 Subject: Refactor SSH testing code out of individual tasks Catch SSH errors and report failures as hints. Also some cleanups and 2to3 fixes. --- kpov_judge/tasks/openwrt/task.py | 13 ------------- 1 file changed, 13 deletions(-) (limited to 'kpov_judge/tasks/openwrt') diff --git a/kpov_judge/tasks/openwrt/task.py b/kpov_judge/tasks/openwrt/task.py index b55905c..98f1420 100644 --- a/kpov_judge/tasks/openwrt/task.py +++ b/kpov_judge/tasks/openwrt/task.py @@ -18,10 +18,6 @@ computers = { 'disks': [ { 'name': 'maliNetworkManager', }, - #{ 'name': 'CDROM', - # 'options':{'readonly': True}, - # 'parts': [],# no parts, no mounting. - #} ], 'network_interfaces': [{'network': 'net1'}], 'flavor': 'm1.tiny', @@ -32,10 +28,6 @@ computers = { 'disks': [ { 'name': 'maliBrezNetworkManager', }, - #{ 'name': 'CDROM', - # 'options':{'readonly': True}, - # 'parts': [],# no parts, no mounting. - #} ], 'network_interfaces': [{'network': 'net1'}], 'flavor': 'm1.tiny', @@ -45,12 +37,7 @@ computers = { 'SimpleArbiter': { 'disks': [ { 'name': 'simpleArbiterDhcp', - # attempt automount }, - #{ 'name': 'CDROM', - # 'options': {'readonly': True}, - # 'parts': [{'dev': 'b1', 'path': '/cdrom'}], - #}, ], 'network_interfaces': [{'network': 'net1'}, {'network': 'test-net'}], 'flavor': 'm1.tiny', -- cgit v1.2.1 From 3091fc2877600f7926ed6a596c316183499125f8 Mon Sep 17 00:00:00 2001 From: Timotej Lazar Date: Sun, 7 Oct 2018 19:11:49 +0200 Subject: Remove coding: lines Python 3 source is utf-8 by default. --- kpov_judge/tasks/openwrt/task.py | 1 - 1 file changed, 1 deletion(-) (limited to 'kpov_judge/tasks/openwrt') diff --git a/kpov_judge/tasks/openwrt/task.py b/kpov_judge/tasks/openwrt/task.py index 98f1420..ee770fe 100644 --- a/kpov_judge/tasks/openwrt/task.py +++ b/kpov_judge/tasks/openwrt/task.py @@ -1,5 +1,4 @@ #!/usr/bin/env python -# -*- coding: utf-8 -*- # kpov_util should be imported by add_assignment.py -- cgit v1.2.1 From dbf585c2a59dbcb7f6d803d5756826b562cd7f43 Mon Sep 17 00:00:00 2001 From: Timotej Lazar Date: Sun, 7 Oct 2018 19:38:40 +0200 Subject: Fix or remove hashbangs --- kpov_judge/tasks/openwrt/task.py | 2 -- 1 file changed, 2 deletions(-) (limited to 'kpov_judge/tasks/openwrt') diff --git a/kpov_judge/tasks/openwrt/task.py b/kpov_judge/tasks/openwrt/task.py index ee770fe..ed2783a 100644 --- a/kpov_judge/tasks/openwrt/task.py +++ b/kpov_judge/tasks/openwrt/task.py @@ -1,5 +1,3 @@ -#!/usr/bin/env python - # kpov_util should be imported by add_assignment.py instructions = { -- cgit v1.2.1