fix wait subprocess

master3.3
Спиридонов Денис 13 years ago
parent f366f296c1
commit ac2c807104

@ -14,7 +14,7 @@
# See the License for the specific language governing permissions and
# limitations under the License.
import os, subprocess
import os
import sys, time
#import time
from sid_func import client_sid

@ -23,7 +23,7 @@ from calculate.api.client.function import get_ip_mac_type
from calculate.api.datavars import DataVarsApi
from calculate.lib.utils import ip as ip_mod
import os, hashlib, time, OpenSSL, pwd, socket
import os, hashlib, OpenSSL, pwd, socket
from os import path
def init(cert, key, cert_path, data_path, certbase, args, port, user_name):
@ -87,7 +87,6 @@ def create_client_cert(server_cert, cert_path, data_path, certbase, user_name):
req_id = create_request(server_cert, cert_path, data_path, certbase, \
client_cert_path)
sign_certificate(req_id, cert_path, data_path)
time.sleep(2)
get_certificate(cert_path, data_path, certbase, client_cert_path)
def check_user_path(user_name):

@ -102,7 +102,7 @@ def check_server_certificate(cert, key, cert_path, args, port, auto = False):
PIPE = subprocess.PIPE
p = subprocess.Popen(cmd, shell=True, stdin=PIPE, stdout=PIPE,
stderr=subprocess.STDOUT, close_fds=True)
time.sleep (2)
p.wait()
# add certificate in trusted
fd = open(cert_path+'/ca_root.crt', 'a')
@ -686,6 +686,7 @@ def sing_req_by_server(id_client_req, cert_path, data_path, auto = False):
PIPE = subprocess.PIPE
p = subprocess.Popen(cmd, shell=True, stdin=PIPE, stdout=PIPE,
stderr=subprocess.STDOUT, close_fds=True)
p.wait()
print _("certificate %s is signed") %cl_cert
return 0
@ -739,6 +740,7 @@ def sing_req_by_root(args, cert_path, data_path):
PIPE = subprocess.PIPE
p = subprocess.Popen(cmd, shell=True, stdin=PIPE, stdout=PIPE,
stderr=subprocess.STDOUT, close_fds=True)
p.wait()
print _("certificate %s is signed") %sign_cert
return 0

@ -14,7 +14,7 @@
# See the License for the specific language governing permissions and
# limitations under the License.
import subprocess, threading
import threading
import os, random
import time, hashlib, datetime

Loading…
Cancel
Save