From 702d7e77a4fbde39bbb93186f8a6400fc6b689af Mon Sep 17 00:00:00 2001 From: "ma0178@student.uni-lj.si" Date: Tue, 13 Jan 2015 08:56:59 +0000 Subject: git-svn-id: https://svn.lusy.fri.uni-lj.si/kpov-public-svn/kpov-public@173 5cf9fbd1-b2bc-434c-b4b7-e852f4f63414 --- kpov_judge/tasks/radius_mysql_pam/task.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'kpov_judge/tasks/radius_mysql_pam/task.py') diff --git a/kpov_judge/tasks/radius_mysql_pam/task.py b/kpov_judge/tasks/radius_mysql_pam/task.py index fc24a67..0beb8e7 100644 --- a/kpov_judge/tasks/radius_mysql_pam/task.py +++ b/kpov_judge/tasks/radius_mysql_pam/task.py @@ -62,13 +62,14 @@ params_meta = { 'RADIUS_SECRET':{'descriptions': {'si': 'Skrivnost RADIUS'}, 'w': False, 'public':True, 'type': 'passwd', 'generated': True}, 'RADIUS_USERNAME': {'descriptions': {'si': 'Username v RADIUS'}, 'w': True, 'public':True, 'type': 'username', 'generated': False}, 'RADIUS_PASSWORD': {'descriptions': {'si': 'Geslo v RADIUS'}, 'w': False, 'public':True, 'type': '', 'generated': True}, + 'MYSQL_DB_NAME': {'descriptions': {'si': 'Ime baze v mysql'}, 'w': True, 'public':True, 'type': '', 'generated': False}, 'MYSQL_ADMIN_USER':{'descriptions': {'si': 'Username za dostop do MySQL'}, 'w': True, 'public':True, 'type': 'username', 'generated': False}, 'MYSQL_ADMIN_PASSWORD': {'descriptions': {'si': 'Geslo za dostop do MySQL'}, 'w': True, 'public':True, 'type': 'passwd', 'generated': True}, 'MYSQL_PAM_USERNAME': {'descriptions': {'si': 'Username v MySQL'}, 'w': True, 'public': True, 'type': 'IP', 'generated': False}, 'MYSQL_PAM_PASSWORD': {'descriptions': {'si': 'Geslo za uporabnika v MySQL'}, 'w': True, 'public': True, 'type': 'passwd', 'generated': False}, } -def task(IP_RS, RADIUS_SECRET, RADIUS_USERNAME, RADIUS_PASSWORD, MYSQL_ADMIN_USER, MYSQL_ADMIN_PASSWORD, MYSQL_PAM_USERNAME, MYSQL_PAM_PASSWORD): +def task(IP_RS, RADIUS_SECRET, RADIUS_USERNAME, RADIUS_PASSWORD, MYSQL_ADMIN_USER, MYSQL_ADMIN_PASSWORD, MYSQL_PAM_USERNAME, MYSQL_PAM_PASSWORD, MYSQL_DB_NAME): import pxssh results = dict() peer_user = 'student' @@ -81,11 +82,10 @@ def task(IP_RS, RADIUS_SECRET, RADIUS_USERNAME, RADIUS_PASSWORD, MYSQL_ADMIN_USE results['Test_RadiusServer'] = sR.run('radtest {0} {1} {3} 1812 {4}'.format( RADIUS_USERNAME, RADIUS_USERNAME, RADIUS_PASSWORD, IP_RS, RADIUS_SECRET)) - # Testiranje podatkovne base mysql - sR.run('mysql -u root -p') + results['mysql_login'] = sR.run('mysql -u {MYSQL_ADMIN_USER} -p {MYSQL_ADMIN_PASSWORD}'.format(**locals())) + results['database_connect'] = sR.run('USE {MYSQL_DB_NAME}'.format(**locals())) - results['Test_PB_mysql'] = sR.run() return results def gen_params(user_id, params_meta): -- cgit v1.2.1