|
|
|
@ -20,6 +20,7 @@ import random, datetime
|
|
|
|
|
import soaplib
|
|
|
|
|
from soaplib.serializers.primitive import String, Integer
|
|
|
|
|
from soaplib.serializers.clazz import Array
|
|
|
|
|
from cert_cmd import find_cert_id
|
|
|
|
|
|
|
|
|
|
# process management
|
|
|
|
|
class ApiWsdl () :
|
|
|
|
@ -95,12 +96,10 @@ class ApiWsdl () :
|
|
|
|
|
self.add_pid_in_file(new_pid)
|
|
|
|
|
return new_pid
|
|
|
|
|
|
|
|
|
|
def serv_pid_kill (self, pid, sid, certbase):
|
|
|
|
|
""" Set flag to complete the process """
|
|
|
|
|
def check_sid_cert (self, sid):
|
|
|
|
|
curThread = threading.currentThread()
|
|
|
|
|
certificate = curThread.client_cert
|
|
|
|
|
|
|
|
|
|
from cert_cmd import find_cert_id
|
|
|
|
|
cert_id = find_cert_id(certificate, self.data_path, self.certbase)
|
|
|
|
|
|
|
|
|
|
# if certificate not found in database
|
|
|
|
@ -128,9 +127,14 @@ class ApiWsdl () :
|
|
|
|
|
flag = 1
|
|
|
|
|
fd.close()
|
|
|
|
|
# if validation fails
|
|
|
|
|
if flag == 0:
|
|
|
|
|
return -2
|
|
|
|
|
return flag
|
|
|
|
|
|
|
|
|
|
def serv_pid_kill (self, pid, sid, certbase):
|
|
|
|
|
""" Set flag to complete the process """
|
|
|
|
|
check_sid = self.check_sid_cert(sid)
|
|
|
|
|
if not check_sid:
|
|
|
|
|
return -2
|
|
|
|
|
|
|
|
|
|
# write complete flag (pid_list[6] = 1) in process file
|
|
|
|
|
if not os.path.exists(self.pids):
|
|
|
|
|
os.system('mkdir %s' %self.pids)
|
|
|
|
|