Browse Source

修改一些bug

pull/2/head
ibuler 10 years ago
parent
commit
a7904a8d57
  1. 8
      webroot/AutoSa/AutoSa/views.py
  2. 2
      webroot/AutoSa/log_handler.py
  3. 3
      webroot/AutoSa/runserver

8
webroot/AutoSa/AutoSa/views.py

@ -290,7 +290,11 @@ def downKey(request):
username = request.GET.get('username') username = request.GET.get('username')
filename = '%s/%s' % (rsa_dir, username) filename = '%s/%s' % (rsa_dir, username)
f = open(filename) try:
f = open(filename)
except IOError:
error = u'密钥文件不存在'
return render_to_response('info.html', {'error': error})
data = f.read() data = f.read()
f.close() f.close()
response = HttpResponse(data, content_type='application/octet-stream') response = HttpResponse(data, content_type='application/octet-stream')
@ -1120,7 +1124,7 @@ def killSession(request):
if pid: if pid:
pid = pid[0] pid = pid[0]
os.kill(pid.cpid, 9) os.kill(pid.cpid, 9)
return HttpResponse('ok') return render_to_response('info.html', {'msg': u'结束会话成功,返回中.'})

2
webroot/AutoSa/log_handler.py

@ -24,7 +24,7 @@ def log_hanler(logid):
ret2 = os.system('cat %s | grep "\[.*@.*\][\$\#]" >> %s.his' % (filename, filename)) ret2 = os.system('cat %s | grep "\[.*@.*\][\$\#]" >> %s.his' % (filename, filename))
ret3 = os.system('cat %s | grep "EndTime" >> %s.his' % (filename, filename)) ret3 = os.system('cat %s | grep "EndTime" >> %s.his' % (filename, filename))
if (ret1 + ret2 + ret3) == 0: if (ret1 + ret2 + ret3) == 0:
print 'Handler % ok.' % filename print 'Handler %s ok.' % filename
def set_finish(id): def set_finish(id):

3
webroot/AutoSa/runserver

@ -1,3 +1,4 @@
#!/bin/bash #!/bin/bash
./manage.py runserver 0.0.0.0:80 ./manage.py runserver 0.0.0.0:80 &> access.log &
./log_handler.py &> handler.log &

Loading…
Cancel
Save