diff options
author | ss5781@student.uni-lj.si <ss5781@student.uni-lj.si@5cf9fbd1-b2bc-434c-b4b7-e852f4f63414> | 2015-01-04 15:56:58 +0000 |
---|---|---|
committer | ss5781@student.uni-lj.si <ss5781@student.uni-lj.si@5cf9fbd1-b2bc-434c-b4b7-e852f4f63414> | 2015-01-04 15:56:58 +0000 |
commit | bb74e3131d4b68e4605fcabc3c6da33a8fe68086 (patch) | |
tree | 684644f557d92c17fb4f2fc2c10629013f707de1 /kpov_judge/tasks | |
parent | f5b04fd1ca56c5cfb64b6c100b8322479d7f626f (diff) |
set_motd->/var/run/motd.dynamic na serverski strani, pobrisi znak '#'
git-svn-id: https://svn.lusy.fri.uni-lj.si/kpov-public-svn/kpov-public@140 5cf9fbd1-b2bc-434c-b4b7-e852f4f63414
Diffstat (limited to 'kpov_judge/tasks')
-rw-r--r-- | kpov_judge/tasks/set_motd/task.py | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/kpov_judge/tasks/set_motd/task.py b/kpov_judge/tasks/set_motd/task.py index 2c4ae0f..99d9ec5 100644 --- a/kpov_judge/tasks/set_motd/task.py +++ b/kpov_judge/tasks/set_motd/task.py @@ -78,11 +78,12 @@ 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) - #TODO original_prompt je za popravit + #s.prompt() + #Ce na serverju iz datoteke /var/run/motd.dynamic pobrisemo znak '#' bi moralo delovati. + 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'] = temp.replace("#","") #zamenja vse pojavitve "#" s praznim stringom - #results['motd'] = s.before # print everything before the prompt. prvotna verzija + #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 # |