Fix console

develop 3.1.1
parent f283e3d44c
commit 7f701c1056

@ -39,12 +39,12 @@ def client_post_cert (client, clVars, show_info = False):
result_post_cert = _result_post_cert[1].integer
result_sid = _result_sid[1].integer
print _('client uses certificate %s') %client.CERT_FILE
print _("the client uses certificate %s") %client.CERT_FILE
print result_post_cert[0]
if result_post_cert[0] == -4:
print _("Certificate not found on the server")
print _('client uses certificate %s') %client.CERT_FILE
print _('You can generate a new certificate using --gen-cert-by and '\
print _("the client uses certificate %s") %client.CERT_FILE
print _('You can generate a new certificate using options --gen-cert-by and '\
'--get-cert-from')
raise Exception(3)
@ -52,7 +52,7 @@ def client_post_cert (client, clVars, show_info = False):
if result_post_cert[0] == -3:
print _("Certificate not sent!")
elif result_post_cert[0] == -2:
print _("Using upstreamer cert")
print _("Using the upstream certificate")
else:
if show_info:
print _(" Your certifitate ID = %d") %(result_post_cert[0])
@ -122,7 +122,7 @@ def delete_old_cert(client):
def client_post_request (cert_path, args):
if os.path.exists(cert_path + 'req_id'):
print \
_("You have already sent a signature request for the certificate.")
_("You already sent a certificate signature request.")
_print (_("Request ID = %s") %open(cert_path + 'req_id', 'r').read())
ans = raw_input (_("Send a new request? y/[n]: "))
if not ans.lower() in ['y','yes']:
@ -145,7 +145,7 @@ def client_post_request (cert_path, args):
key = os.path.join(cert_path, server_host_name + '.key')
csr_file = os.path.join(cert_path, server_host_name +'.csr')
if os.path.exists(key) and os.path.exists(csr_file):
print _('private key and request now exist')
print _("the private key and request now exist")
ask = raw_input(_("Create a new private key and request? y/[n]: "))
if ask.lower() in ['y','yes']:
passwd = get_password()
@ -161,13 +161,13 @@ def client_post_request (cert_path, args):
res = client.service.post_client_request(request = data, ip = ip,\
mac = mac, client_type = client_type)
if int(res) < 0:
print _("This server has not signed the certificate!")
print _("The server has not signed the certificate!")
return 1
fc = open(os.path.join(cert_path, 'req_id'), 'w')
fc.write(res)
fc.close()
_print (_("Your request ID = %s") %res + '.\n',
_("To sign the certificate in the server use command") + \
_("To submit the certificate request on the server use command") + \
'\n'+'cl-core --sign-client ID_CLIENT_REQUEST')
return 0
@ -209,16 +209,16 @@ def client_get_cert(cert_path, args):
except IndexError:
ca_root = None
if cert == '1':
print _('Request to sign is rejected!')
print _("Signature request rejected!")
return 1
elif cert == '2':
print _("Signature request not reviewed yet.")
print _("Signature request not examined yet.")
print _("Your request ID = %s") %req_id + '.\n',\
_("To sign the certificate in the server use command") + \
_("To submit the certificate request on the server use command") + \
'\n'+'cl-core --sign-client ID_CLIENT_REQUEST'
return 1
elif cert == '3':
print _("Signature request not matching earlier data.")
print _("Request or signature not matching earlier data.")
return 1
elif cert == '4':
print _("The request was sent from another IP.")
@ -304,7 +304,7 @@ def client_get_cert(cert_path, args):
print _("filename = "), filename
print _("Certificate added")
else:
print _("A file with CA certificates now exists")
print _("The file containing the CA certificate now exists")
return 0
def client_post_auth(client):
@ -316,9 +316,7 @@ def client_post_auth(client):
pass#client_post_cert(client)
else:
#client_post_request(client)
print _("You do not have a certificate. Use --gen-cert-by HOST "
"to generate a new request or --get-cert-from HOST to "
"get a new certificate from the server.")
print _("You do not have a certificate. Use option --gen-cert-by HOST to generate a new request or --get-cert-from HOST to get a new certificate from the server.")
raise Exception(1)
# print client.service.versions(sid, VERSION)
except VerifyError, e:

@ -289,7 +289,7 @@ def https_server(client, args, unknown_args, url, clVarsCore, wait_thread):
elif result == -2:
print _("Session not matching your certificate")
elif result == 1:
print _("Failed to kill the process")
print _("Failed to terminate the process")
# get_entire_frame(client, pid)
analysis(client, client.sid, method_result)
except Exception, e:
@ -417,7 +417,7 @@ def main(wait_thread):
except KeyboardInterrupt:
wait_thread.stop()
red = '\n'+'\033[31m * \033[0m'
print red + _('Interrupted by the user')
print red + _("Manually interrupted")
except Exception, e:
wait_thread.stop()
if type(e.message) != int:
@ -437,7 +437,7 @@ def main(wait_thread):
except KeyboardInterrupt:
wait_thread.stop()
red = '\n'+'\033[31m * \033[0m'
print red + _('Interrupted by the user')
print red + _("Manually interrupted")
except Exception, e:
print _("Exception: %s") %e
tb.print_exc()
@ -458,7 +458,7 @@ def main(wait_thread):
except KeyboardInterrupt:
wait_thread.stop()
red = '\n'+'\033[31m * \033[0m'
print red + _('Interrupted by the user')
print red + _("Manually interrupted")
try:
import glob
@ -519,7 +519,7 @@ def main(wait_thread):
except KeyboardInterrupt:
wait_thread.stop()
red = '\n'+'\033[31m * \033[0m'
print red + _('Interrupted by the user')
print red + _("Manually interrupted")
except Exception, e:
wait_thread.stop()
if type(e.message) != int:
@ -540,7 +540,7 @@ def main(wait_thread):
except KeyboardInterrupt:
wait_thread.stop()
red = '\n'+'\033[31m * \033[0m'
print red + _('Interrupted by the user')
print red + _("Manually interrupted")
except Exception, e:
print _("Exception: %s") %e
tb.print_exc()

@ -180,7 +180,7 @@ class CheckingClientHTTPSConnection(CheckingHTTPSConnection):
print _("filename = "), filename
print _("Certificate added")
else:
print _("A file with CA certificates now exists")
print _("The file containing the CA certificate now exists")
get_CRL(cl_client_cert_dir)
def add_ca_cert(self, cert, list_ca_certs):
@ -190,11 +190,11 @@ class CheckingClientHTTPSConnection(CheckingHTTPSConnection):
client.wsdl.services[0].setlocation(url)
cert = client.service.get_ca()
if cert == '1':
print _('Invalid server certificate')
print _("Invalid server certificate!")
raise Exception(1)
if cert == '2':
print _('CA not found on the server')
print _("CA certificate not found on the server")
raise Exception(1)
try:
@ -238,7 +238,7 @@ class CheckingClientHTTPSConnection(CheckingHTTPSConnection):
print "%s : %s" %(item[0], item[1])
print '\n' + _('Add this server certificate to trusted (s) or')
print _('Try to add the CA and ROOT certificates to trusted (c) or')
print _('Try to add the CA and root certificates to trusted (c) or')
choice = raw_input (_("Quit (q)? s/c/[q]: "))
if choice.lower() in ['s', 'c']:
#self.sock = ssl.wrap_socket(sock)
@ -287,7 +287,7 @@ class CheckingClientHTTPSConnection(CheckingHTTPSConnection):
print _("Failed to create directory %s") %root_cert_dir
raise Exception(1)
print '\n' + _("Try to add the CA and ROOT certificates")
print '\n' + _("Add the CA and root certificates")
self.list_ca_certs = []
self.add_ca_cert(cert, self.list_ca_certs)
return 3

@ -63,7 +63,7 @@ def makeRequest(pubkey, pkey, serv_host, auto = False):
#list_host_name[len(list_host_name)-1]+"@"+serv_host
#else:
#host_name = socket.getfqdn()
name.CN = raw_input (_('Host Name [%s] : ') %result_host_name)
name.CN = raw_input (_('Host Name [%s]: ') %result_host_name)
if name.CN in ['', None]:
name.CN = result_host_name
@ -73,7 +73,7 @@ def makeRequest(pubkey, pkey, serv_host, auto = False):
name.O = raw_input (_('Organization Name: '))
name.L = raw_input (_('Network address (hostname or IP) [%s]: ')\
%host_name)
name.ST = raw_input (_('State Name: '))
name.ST = raw_input (_('City: '))
name.C = raw_input (_('Country (2 characters): [%s]') %lang)
if not name.C:
name.C = lang

@ -347,7 +347,7 @@ def analysis(client, sid, s):
try:
pid = int(mess.message)
except:
show_error(_('the server sent pid = ') + pid)
show_error(_('the server sent PID = ') + pid)
return 1
get_messages(client, sid, pid)
elif mess.type == 'error':

@ -35,7 +35,7 @@ def parse():
'--method', type=str, dest='method', help=_('call method'))
parser.add_argument(
'-l', '--lang', type=str, dest='lang',
help=_('language for translation'))
help=_('translation language'))
parser.add_argument(
'-p', '--port', type=int, default = '8888', dest='port',
help=_('port number'))
@ -45,7 +45,7 @@ def parse():
parser.add_argument(
'--gen-cert-by', type=str, dest='by_host', metavar = 'HOST',
help = \
_('post a request on the server for the certificate to be signed'))
_('send a certificate signature request to the server'))
parser.add_argument(
'--get-cert-from', type=str, dest='from_host', metavar = 'HOST',
help=_('get the signed certificate from the server'))
@ -57,7 +57,7 @@ def parse():
dest='list_pid', help=_("view the list of running processes"))
parser.add_argument(
'-d', '--dump', action='store_true', default=False, dest = 'dump',
help=_('dump (to be used with --list-pid)'))
help=_('dump (to be used with option --list-pid)'))
parser.add_argument(
'--pid-result', type=int, metavar = 'PID',
dest='pid_res', help=_("view the result of the process"))
@ -77,7 +77,7 @@ def parse():
parser.add_argument(
'--session-list', action='store_true', default=False,
dest='session_list',
help=_("view the active sessions list on the server"))
help=_("view the active server sessions"))
parser.add_argument(
'--update-crl', action='store_true', default=False,
dest='update_crl', help=_("update the revocation list"))
@ -93,7 +93,7 @@ def parse():
parser.add_argument(
'-P', action='store_true', default=False,
dest = 'stdin_passwd',
help=_('use passwords for the users accounts from standard input'))
help=_("use passwords from standard input for users accounts"))
return parser
def get_view(client, method, sid, view_params):
@ -165,7 +165,7 @@ def call_method(client, args, unknown_args, wait_thread):
ask = 'no'
red = '\n'+'\033[31m * \033[0m'
if ask.lower() in ['n', 'no']:
print red + _('Interrupted by the user')
print red + _("Manually interrupted")
return None
if ask.lower() in ['y', 'yes']:
break

@ -52,13 +52,13 @@ def client_list_pid(client):
try:
list_pid = client.service.list_pid(sid = sid)
if list_pid[0][0] == 0:
print red + _("PID not found for this session!")
print red + _("PIDs not found for this session!")
return 0
else:
for i in list_pid[0]:
print green + "pid - %d" %i
except:
print red + _("The server gets PID errors")
print red + _("Error fetching the PID list from the server")
return 1
return len(list_pid[0])
@ -69,13 +69,13 @@ def gen_pid_ls(client):
try:
list_pid = client.service.list_pid(sid = sid)
if list_pid[0][0] == 0:
print _("PID not found for this session!")
print _("PIDs not found for this session!")
return 0
else:
for i in list_pid[0]:
pid_ls.append(i)
except:
print _("The server gets PID errors")
print _("Error fetching the PID list from the server")
return 0
return pid_ls
@ -108,7 +108,7 @@ def client_list_methods(client):
return 1
except:
pass
print _("You can execute:"), _('use'), '--method'
print _("You can execute:"), _('use option'), '--method'
group_dict = {}
for group in results.stringArray:
if len (group.string) == 4:
@ -135,5 +135,5 @@ def client_pid_kill(client, pid):
elif result == -2:
print _("Session not matching your certificate")
elif result == 1:
print _("Failed to kill the process")
print _("Failed to terminate the process")
return 0

@ -54,9 +54,9 @@ def client_del_sid(client):
fi = open(client.SID_FILE, 'w')
fi.write('0')
fi.close()
print _("SID Deleted!")
print _("SID deleted!")
except:
print _("SID deletion error")
print _("SID deletion error on the server")
return 1
return 0
@ -91,7 +91,7 @@ def client_session_info(client, sid = None):
except Exception, e:
if type (e.message) == tuple and len(e.message) == 2 \
and e.message[1] == 'Forbidden':
print _('Access Forbidden!')
print _("Access forbidden!")
else:
print e
return 1
@ -104,7 +104,7 @@ def client_session_list(client):
except Exception, e:
if type (e.message) == tuple and len(e.message) == 2 \
and e.message[1] == 'Forbidden':
print _('Access Forbidden!')
print _("Access forbidden!")
else:
print e
return 1
@ -123,7 +123,7 @@ def session_clean(client):
except Exception, e:
if type (e.message) == tuple and len(e.message) == 2 \
and e.message[1] == 'Forbidden':
print _('Access Forbidden!')
print _("Access forbidden!")
else:
print e
if res:

Loading…
Cancel
Save