diff options
author | mj7196@student.uni-lj.si <mj7196@student.uni-lj.si@5cf9fbd1-b2bc-434c-b4b7-e852f4f63414> | 2014-12-10 19:03:59 +0000 |
---|---|---|
committer | mj7196@student.uni-lj.si <mj7196@student.uni-lj.si@5cf9fbd1-b2bc-434c-b4b7-e852f4f63414> | 2014-12-10 19:03:59 +0000 |
commit | 5f451899c4aa56caf40d4d9e100498abe1d28cbc (patch) | |
tree | 3f50fd6982a86b7ec6e2669277691240e11cd09f /kpov_judge/tasks/custom_rdate | |
parent | 49411549d7b4d64c40d53af156e737c87cbf150f (diff) |
Funkcijo gen_params sem spremenil tako, da sem generiral nakljucen string crk in stevilk, katere pa sem dobil preko datuma, in je tako to lahko enolicna cifra vedno drugacna.
git-svn-id: https://svn.lusy.fri.uni-lj.si/kpov-public-svn/kpov-public@22 5cf9fbd1-b2bc-434c-b4b7-e852f4f63414
Diffstat (limited to 'kpov_judge/tasks/custom_rdate')
-rw-r--r-- | kpov_judge/tasks/custom_rdate/task.py | 10 |
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): |