summaryrefslogtreecommitdiff
path: root/kpov_judge/tasks
diff options
context:
space:
mode:
Diffstat (limited to 'kpov_judge/tasks')
-rw-r--r--kpov_judge/tasks/custom_rdate/task.py10
1 files changed, 9 insertions, 1 deletions
diff --git a/kpov_judge/tasks/custom_rdate/task.py b/kpov_judge/tasks/custom_rdate/task.py
index ae3804c..304ed1a 100644
--- a/kpov_judge/tasks/custom_rdate/task.py
+++ b/kpov_judge/tasks/custom_rdate/task.py
@@ -79,15 +79,23 @@ def task(IP_NM, DNS_NM, IP_static, DNS_static):
sB.logout()
return results
+import datetime
+import random
def gen_params(user_id, params_meta):
+ crke = "ABCDEFGHIJKLMNOPRSTUVZXYQW"
+ time = datetime.datetime.now().strftime("%Y%m%d%H%M%S)
+ sifra = ""
+ for x in time:
+ for i in x:
+ sifra+=random.choice(crke) + i + random.choice(crke)
params = dict()
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)
params['DNS_NM'] = r.choice(dns_servers)
params['IP_NM'], params['IP_static'] = kpov_random_helpers.IPv4_addr_gen(r, net, 2)
params['DNS_static'] = r.choice(dns_servers)
+ params[user_id] = sifra
return params
def task_check(results, params):