summaryrefslogtreecommitdiff
path: root/kpov_judge/tasks/set_motd
diff options
context:
space:
mode:
authorgasperfele@fri1.uni-lj.si <gasperfele@fri1.uni-lj.si@5cf9fbd1-b2bc-434c-b4b7-e852f4f63414>2015-01-28 14:12:13 +0000
committergasperfele@fri1.uni-lj.si <gasperfele@fri1.uni-lj.si@5cf9fbd1-b2bc-434c-b4b7-e852f4f63414>2015-01-28 14:12:13 +0000
commit677e3ac2a4687e15f40dbc060f1bbb96b01d2c58 (patch)
treedbba338cba9e8bbb198b45ffb7da1503cb683199 /kpov_judge/tasks/set_motd
parent6a4a5a588e247d9a51425ebe62595e043a84b0d2 (diff)
Fixed, tested set_motd task(), task_check()
git-svn-id: https://svn.lusy.fri.uni-lj.si/kpov-public-svn/kpov-public@247 5cf9fbd1-b2bc-434c-b4b7-e852f4f63414
Diffstat (limited to 'kpov_judge/tasks/set_motd')
-rw-r--r--kpov_judge/tasks/set_motd/task.py7
1 files changed, 5 insertions, 2 deletions
diff --git a/kpov_judge/tasks/set_motd/task.py b/kpov_judge/tasks/set_motd/task.py
index c8b42e3..cfea848 100644
--- a/kpov_judge/tasks/set_motd/task.py
+++ b/kpov_judge/tasks/set_motd/task.py
@@ -78,10 +78,11 @@ def task(peer_ip, peer_user, peer_passwd, niz):
s = pxssh.pxssh()
#TODO (polz): tole bi utegnilo delovati http://pexpect.sourceforge.net/pxssh.html. Testirajte
s.login (peer_ip, peer_user, peer_passwd, original_prompt=r'{0}@.*:\~\$'.format(peer_user),auto_prompt_reset=False)
- s.prompt()
+ # print s.before
+ # s.prompt()
#Ce na serverju iz datoteke /var/run/motd.dynamic pobrisemo znak '#' bi moralo delovati.
- temp = s.before # print everything before the prompt.
+ # temp = s.before # print everything before the prompt.
#TODO (polz): tole ni pravi pristop. Problem je bil v tem, da pxssh ni prav zaznal, kdaj je prijavljen. Glej link zgoraj.
results['motd'] = s.before # print everything before the prompt.
return results
@@ -92,6 +93,8 @@ def gen_params(user_id, params_meta):
def task_check(results, params):
#print task_url
+ #print params
+ #print results
niz = params['niz']
score = 0
if (results['motd'].find(niz) > -1):