summaryrefslogtreecommitdiff
path: root/kpov_judge/tasks/public_ip_ssh
diff options
context:
space:
mode:
Diffstat (limited to 'kpov_judge/tasks/public_ip_ssh')
-rw-r--r--kpov_judge/tasks/public_ip_ssh/task.py25
1 files changed, 9 insertions, 16 deletions
diff --git a/kpov_judge/tasks/public_ip_ssh/task.py b/kpov_judge/tasks/public_ip_ssh/task.py
index a566aa5..561a1fa 100644
--- a/kpov_judge/tasks/public_ip_ssh/task.py
+++ b/kpov_judge/tasks/public_ip_ssh/task.py
@@ -1,9 +1,4 @@
-#!/usr/bin/env python
-# -*- coding: utf-8 -*-
-
-# bson.son.SON an
-# kpov_random_helpers should be imported by add_assignment.py
-OrderedDict = SON
+# kpov_util should be imported by add_assignment.py
instructions = {
'si':"""
@@ -39,21 +34,19 @@ def task(peer_ip, peer_user, peer_passwd):
return dict()
def gen_params(user_id, params_meta):
- return kpov_random_helpers.default_gen(user_id, params_meta)
+ return kpov_util.default_gen(user_id, params_meta)
def task_check(results, params):
from pexpect import pxssh
- import pexpect
- results = dict()
- s = pxssh.pxssh()
- peer_ip, peer_user, peer_passwd = params['peer_ip'], params['peer_user'], params['peer_passwd']
+ ip, user, passwd = params['peer_ip'], params['peer_user'], params['peer_passwd']
+ results = {}
try:
- s.login(peer_ip, peer_user, peer_passwd)
+ s = pxssh.pxssh(encoding='utf-8')
+ s.login(ip, user, passwd)
s.logout()
- except Exception as e:
- return 0, [str(e)]
- return 10, []
+ return 10, []
+ except Exception as ex:
+ return 0, [str(ex)]
def prepare_disks(templates, task_params, global_params):
write_default_config(templates['simpleArbiter'], global_params)
- # print d1.ls('/')