diff options
author | sv1004@student.uni-lj.si <sv1004@student.uni-lj.si@5cf9fbd1-b2bc-434c-b4b7-e852f4f63414> | 2014-12-22 15:55:11 +0000 |
---|---|---|
committer | sv1004@student.uni-lj.si <sv1004@student.uni-lj.si@5cf9fbd1-b2bc-434c-b4b7-e852f4f63414> | 2014-12-22 15:55:11 +0000 |
commit | 310d84d2cb99bca6fb4a2e1c7372cf65a5345b78 (patch) | |
tree | 478ef3598d4a3c5692e6ed45e2313674f30c81e3 /kpov_judge | |
parent | a90e988c336fe729833aed81471b5028c4110ac9 (diff) |
git-svn-id: https://svn.lusy.fri.uni-lj.si/kpov-public-svn/kpov-public@120 5cf9fbd1-b2bc-434c-b4b7-e852f4f63414
Diffstat (limited to 'kpov_judge')
-rw-r--r-- | kpov_judge/tasks/set_ip_static_dhcp/task.py | 15 |
1 files changed, 6 insertions, 9 deletions
diff --git a/kpov_judge/tasks/set_ip_static_dhcp/task.py b/kpov_judge/tasks/set_ip_static_dhcp/task.py index 5321f9b..98ab069 100644 --- a/kpov_judge/tasks/set_ip_static_dhcp/task.py +++ b/kpov_judge/tasks/set_ip_static_dhcp/task.py @@ -79,12 +79,10 @@ def task(IP_NM, DNS_NM, IP_static, DNS_static): sB = pxssh.pxssh() sA.login(IP_NM, peer_user, peer_passwd) sB.login(IP_static, peer_user, peer_passwd) - # sA - # make sure NM is not handling eth0 + # sA - network manager results['NM_nmcli'] = sA.run('nmcli d') results['NM_nslookup'] = sA.run('nslookup www.arnes.si') - # sB - # check whether NM is handling eth0 + # sB - brez network manager results['static_nmcli'] = sB.run('nmcli d') results['static_nslookup'] = sB.run('nslookup www.arnes.si') sA.logout() @@ -104,15 +102,14 @@ def gen_params(user_id, params_meta): def task_check(results, params): import re - # TODO: (polz) preveri, da na maliNetworkManager NetworkManager skrbi za eth0. - score = -9 - if results['NM_nslookup'].find('Server:\t\t{0}\r'.format(params['DNS_NM'])) > -1: + score = 0 + if results['NM_nslookup'].find(params['DNS_NM']) > -1: score += 3 - if results['static_nslookup'].find('Server:\t\t{0}\r'.format(params['DNS_static'])) > -1: + if results['static_nslookup'].find(params['DNS_static']) > -1: score += 3 if re.search(r'eth0 +802-.*connected', results['NM_nmcli']): score += 2 - if not re.search(r'eth0 +802-.*connected', results['static_nmcli']): + if not re.search(r'eth0 +802-.*unmanaged', results['static_nmcli']): score += 2 return score |