summaryrefslogtreecommitdiff
path: root/kpov_judge/tasks/radius_mysql_pam
diff options
context:
space:
mode:
authorgasperfele@fri1.uni-lj.si <gasperfele@fri1.uni-lj.si@5cf9fbd1-b2bc-434c-b4b7-e852f4f63414>2015-01-20 06:57:28 +0000
committergasperfele@fri1.uni-lj.si <gasperfele@fri1.uni-lj.si@5cf9fbd1-b2bc-434c-b4b7-e852f4f63414>2015-01-20 06:57:28 +0000
commitd7863521951c703e9e969eb056444873df0de9c9 (patch)
tree635cc389e26f44147e097d6382c9a85f320be33d /kpov_judge/tasks/radius_mysql_pam
parent4411b2df35e7ed0c0b90cd26e84cde969483e95f (diff)
fixed import in gen_params for radius_mysql_pam
git-svn-id: https://svn.lusy.fri.uni-lj.si/kpov-public-svn/kpov-public@217 5cf9fbd1-b2bc-434c-b4b7-e852f4f63414
Diffstat (limited to 'kpov_judge/tasks/radius_mysql_pam')
-rw-r--r--kpov_judge/tasks/radius_mysql_pam/task.py12
1 files changed, 6 insertions, 6 deletions
diff --git a/kpov_judge/tasks/radius_mysql_pam/task.py b/kpov_judge/tasks/radius_mysql_pam/task.py
index cd0fb46..0c656d5 100644
--- a/kpov_judge/tasks/radius_mysql_pam/task.py
+++ b/kpov_judge/tasks/radius_mysql_pam/task.py
@@ -99,12 +99,12 @@ def gen_params(user_id, params_meta):
params = dict()
r = random.Random(user_id)
for name, meta in params_meta.iteritems():
- params[name] = default_generators[meta.get('type', None)](r)
- params['RADIUS_SECRET'] = alnum_gen(r, 8)
- params['RADIUS_PASSWORD'] = alnum_gen(r, 4)
- params['MYSQL_ADMIN_PASSWORD'] = alnum_gen(r, 4)
- net = IPv4_subnet_gen(r)
- ip_radius_server = IPv4_addr_gen(r, net, 1)[0]
+ params[name] = kpov_random_helpers.default_generators[meta.get('type', None)](r)
+ params['RADIUS_SECRET'] = kpov_random_helpers.alnum_gen(r, 8)
+ params['RADIUS_PASSWORD'] = kpov_random_helpers.alnum_gen(r, 4)
+ params['MYSQL_ADMIN_PASSWORD'] = kpov_random_helpers.alnum_gen(r, 4)
+ net = kpov_random_helpers.IPv4_subnet_gen(r)
+ ip_radius_server = kpov_random_helpers.IPv4_addr_gen(r, net, 1)[0]
params['IP_RS'] = ip_radius_server
return params