summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-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