Добавлено использование переменной cl_core_port для порта по умолчанию

develop 3.2.0_alpha1
Mike khiretskiy 11 years ago
parent 56bc261292
commit d08f2add76

@ -127,8 +127,13 @@ def client_post_request (cert_path, args):
ans = raw_input (_("Send a new request? y/[n]: "))
if not ans.lower() in ['y','yes']:
return 0
clVars = DataVarsCore()
clVars.importCore()
clVars.flIniFile()
url = "https://%s:%d/?wsdl" %(args.by_host, args.port)
port = args.port or clVars.Get('core.cl_core_port')
url = "https://%s:%d/?wsdl" %(args.by_host, port)
print '%s\n'% url, _("connecting...")
from client_class import Client_suds
try:
@ -172,6 +177,10 @@ def client_post_request (cert_path, args):
return 0
def client_get_cert(cert_path, args):
clVars = DataVarsCore()
clVars.importCore()
clVars.flIniFile()
if not os.path.exists(os.path.join(cert_path, 'req_id')):
print _("Request not sent or file %s deleted") \
%(os.path.join(cert_path, 'req_id'))
@ -180,7 +189,8 @@ def client_get_cert(cert_path, args):
req_id = fc.read()
fc.close()
url = "https://%s:%d/?wsdl" %(args.from_host, args.port)
port = args.port or clVars.Get('core.cl_core_port')
url = "https://%s:%d/?wsdl" %(args.from_host, port)
print '%s\n' %url, _("connecting...")
from client_class import Client_suds
@ -242,9 +252,6 @@ def client_get_cert(cert_path, args):
os.chmod(cert_file, 0600)
if ca_root:
clVars = DataVarsCore()
clVars.importCore()
clVars.flIniFile()
system_ca_db = clVars.Get('core.cl_glob_root_cert')
if os.path.exists(system_ca_db):
if ca_root in open(system_ca_db, 'r').read():

@ -116,6 +116,7 @@ def connect_with_cert(cert, path_to_cert, url, args, wait_thread, clVarsCore,
bio = M2Crypto.BIO.openfile(CERT_KEY)
rsa = M2Crypto.m2.rsa_read_key(bio._ptr(),lambda *unused: None)
if not rsa:
port = args.port or clVarsCore.Get('core.cl_core_port')
store_passwd = get_password_from_daemon(args.host, args.port,
wait_thread)
if 'store_passwd' in locals():
@ -341,7 +342,7 @@ def main(wait_thread):
homePath = clVarsCore.Get('ur_home_path')
port = args.port
port = args.port or clVarsCore.GetInteger('core.cl_core_port')
host = args.host
path_to_cert = args.path_to_cert
if not path_to_cert:

@ -37,7 +37,7 @@ def parse():
'--translate-language', type=str, dest='lang',
help=_('translation language'))
parser.add_argument(
'--port', type=int, default = '8888', dest='port',
'--port', type=int, dest='port',
help=_('port number'))
parser.add_argument(
'--host', type=str, default = 'localhost', dest='host',

Loading…
Cancel
Save