|
|
|
@ -126,51 +126,54 @@ def call_method(client, args, unknown_args, wait_thread):
|
|
|
|
|
sys.stdout.flush()
|
|
|
|
|
_print (_('Unknown parameter'), i)
|
|
|
|
|
raise Exception(1)
|
|
|
|
|
param_object, steps = collect_object(client, param_object, view, args,
|
|
|
|
|
wait_thread,stdin_passwd=stdin_passwd)
|
|
|
|
|
if steps.label and hasattr (param_object, 'CheckOnly'):
|
|
|
|
|
param_object['CheckOnly'] = True
|
|
|
|
|
check_res = {}
|
|
|
|
|
while True:
|
|
|
|
|
method_result = client.service[0][method](client.sid,param_object)
|
|
|
|
|
if not method_result:
|
|
|
|
|
print _('Method not available')
|
|
|
|
|
return None
|
|
|
|
|
if method_result.ReturnedMessage[0].type and \
|
|
|
|
|
method_result.ReturnedMessage[0].type != "pid":
|
|
|
|
|
wait_thread.stop()
|
|
|
|
|
|
|
|
|
|
check_res = check_result_msg(method_result, view, check_res)
|
|
|
|
|
if not check_res:
|
|
|
|
|
return None
|
|
|
|
|
else:
|
|
|
|
|
param_object = get_param_pwd(check_res, view,
|
|
|
|
|
param_object, client)
|
|
|
|
|
else:
|
|
|
|
|
break
|
|
|
|
|
|
|
|
|
|
view_params = get_view_params(client, method + '_view', step = None, \
|
|
|
|
|
expert = True, brief = True)
|
|
|
|
|
view = get_view(client, method, client.sid, view_params)
|
|
|
|
|
wait_thread.stop()
|
|
|
|
|
sys.stdout.write('\r')
|
|
|
|
|
sys.stdout.flush()
|
|
|
|
|
print_brief(view, steps.label)
|
|
|
|
|
if not no_questions:
|
|
|
|
|
if not view.groups is None:
|
|
|
|
|
param_object, steps = collect_object(client, param_object, view, args,
|
|
|
|
|
wait_thread,stdin_passwd=stdin_passwd)
|
|
|
|
|
if steps.label and hasattr (param_object, 'CheckOnly'):
|
|
|
|
|
param_object['CheckOnly'] = True
|
|
|
|
|
check_res = {}
|
|
|
|
|
while True:
|
|
|
|
|
try:
|
|
|
|
|
ask = raw_input('\n' + _('Run the process? (yes/no): '))
|
|
|
|
|
red = '\033[31m * \033[0m'
|
|
|
|
|
except KeyboardInterrupt:
|
|
|
|
|
ask = 'no'
|
|
|
|
|
red = '\n'+'\033[31m * \033[0m'
|
|
|
|
|
if ask.lower() in ['n', 'no']:
|
|
|
|
|
print red + _("Manually interrupted")
|
|
|
|
|
method_result = client.service[0][method](client.sid,param_object)
|
|
|
|
|
if not method_result:
|
|
|
|
|
print _('Method not available')
|
|
|
|
|
return None
|
|
|
|
|
if ask.lower() in ['y', 'yes']:
|
|
|
|
|
if method_result.ReturnedMessage[0].type and \
|
|
|
|
|
method_result.ReturnedMessage[0].type != "pid":
|
|
|
|
|
wait_thread.stop()
|
|
|
|
|
|
|
|
|
|
check_res = check_result_msg(method_result, view, check_res)
|
|
|
|
|
if not check_res:
|
|
|
|
|
return None
|
|
|
|
|
else:
|
|
|
|
|
param_object = get_param_pwd(check_res, view,
|
|
|
|
|
param_object, client)
|
|
|
|
|
else:
|
|
|
|
|
break
|
|
|
|
|
|
|
|
|
|
param_object['CheckOnly'] = False
|
|
|
|
|
view_params = get_view_params(client, method + '_view', step = None, \
|
|
|
|
|
expert = True, brief = True)
|
|
|
|
|
view = get_view(client, method, client.sid, view_params)
|
|
|
|
|
wait_thread.stop()
|
|
|
|
|
sys.stdout.write('\r')
|
|
|
|
|
sys.stdout.flush()
|
|
|
|
|
print_brief(view, steps.label)
|
|
|
|
|
if not no_questions:
|
|
|
|
|
while True:
|
|
|
|
|
try:
|
|
|
|
|
ask = raw_input('\n' + _('Run the process? (yes/no): '))
|
|
|
|
|
red = '\033[31m * \033[0m'
|
|
|
|
|
except KeyboardInterrupt:
|
|
|
|
|
ask = 'no'
|
|
|
|
|
red = '\n'+'\033[31m * \033[0m'
|
|
|
|
|
if ask.lower() in ['n', 'no']:
|
|
|
|
|
print red + _("Manually interrupted")
|
|
|
|
|
return None
|
|
|
|
|
if ask.lower() in ['y', 'yes']:
|
|
|
|
|
break
|
|
|
|
|
|
|
|
|
|
param_object['CheckOnly'] = False
|
|
|
|
|
else:
|
|
|
|
|
param_object = {}
|
|
|
|
|
method_result = client.service[0][method](client.sid, param_object)
|
|
|
|
|
if not method_result:
|
|
|
|
|
print _('Method not available')
|
|
|
|
|