diff options
Diffstat (limited to 'kpov_judge/tasks/set_motd')
-rw-r--r-- | kpov_judge/tasks/set_motd/task.py | 15 |
1 files changed, 1 insertions, 14 deletions
diff --git a/kpov_judge/tasks/set_motd/task.py b/kpov_judge/tasks/set_motd/task.py index 956f570..5f1b0b3 100644 --- a/kpov_judge/tasks/set_motd/task.py +++ b/kpov_judge/tasks/set_motd/task.py @@ -76,20 +76,7 @@ params_meta = { def task(peer_ip, peer_user, peer_passwd, niz): "Check whether ssh works" - import collections - from pexpect import pxssh - results = collections.defaultdict(str) - try: - s = pxssh.pxssh(encoding='utf-8') - s.login(peer_ip, peer_user, peer_passwd, - original_prompt=r'{0}@.*:\~\$'.format(peer_user), - auto_prompt_reset=False) - results['ssh'] = True - results['motd'] = s.before - s.logout() - except Exception as ex: - results['ssh'] = str(ex) - return results + return kpov_util.ssh_test(peer_ip, peer_user, peer_passwd) def gen_params(user_id, params_meta): return kpov_util.default_gen(user_id, params_meta) |