summaryrefslogtreecommitdiff
path: root/kpov_judge/tasks/set_ip_static_dhcp
diff options
context:
space:
mode:
Diffstat (limited to 'kpov_judge/tasks/set_ip_static_dhcp')
-rw-r--r--kpov_judge/tasks/set_ip_static_dhcp/task.py15
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