From e0172c0b47c502eeebaf56ef30ecd3373be0e17b Mon Sep 17 00:00:00 2001 From: "gasperfele@fri1.uni-lj.si" Date: Mon, 19 Dec 2016 09:26:21 +0000 Subject: fixed permissions in for a SNMP script on snmp_agent_uptime git-svn-id: https://svn.lusy.fri.uni-lj.si/kpov-public-svn/kpov-public@372 5cf9fbd1-b2bc-434c-b4b7-e852f4f63414 --- kpov_judge/tasks/snmp_agent_uptime/task.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'kpov_judge/tasks') diff --git a/kpov_judge/tasks/snmp_agent_uptime/task.py b/kpov_judge/tasks/snmp_agent_uptime/task.py index d57d28e..f007eec 100644 --- a/kpov_judge/tasks/snmp_agent_uptime/task.py +++ b/kpov_judge/tasks/snmp_agent_uptime/task.py @@ -173,8 +173,10 @@ def task_check(results, params): client_script_uptime = int(results['client_script'].strip()) client_uptime = int(results['client_uptime'].strip()) d = client_uptime - client_script_uptime*60 - if d >= 0 and d < 60: + if d >= 0 and d < 2: score += 3 + else: + hints += "client uptime script output wrong." server_uptime = int(results['server_uptime'].strip()) lines = results['server_OID'].split('\n') unique_part_start = params['SNMP_UPTIME_OID'].find('"') @@ -214,5 +216,5 @@ elif action == '-n' and oid < ".{oid}": print "{val}" """.format(oid = task_params['SNMP_CLIENT_OID'], val = task_params['SNMP_VALUE']) templates['student-SNMPServer'].write('/usr/local/bin/snmpext.py', prog) - templates['student-SNMPServer'].chmod(0766, '/usr/local/bin/snmpext.py') + templates['student-SNMPServer'].chmod(0755, '/usr/local/bin/snmpext.py') write_default_config(templates['simpleArbiterDhcpGW'], global_params) -- cgit v1.2.1