|
|
@ -148,7 +148,9 @@ def update_cine(request): |
|
|
|
cinema_update_status[cinema_ip]['setup']['result'] = 'running' |
|
|
|
cinema_update_status[cinema_ip]['setup']['result'] = 'running' |
|
|
|
setup_list = list(set(cmd_list) & set(cmd_dict['setup'])) |
|
|
|
setup_list = list(set(cmd_list) & set(cmd_dict['setup'])) |
|
|
|
update_cmd = UpdateCommandUtil() |
|
|
|
update_cmd = UpdateCommandUtil() |
|
|
|
setup_output = update_cmd.exec_cmd_by_type(cinema_ip, 'setup', setup_list, short_release) |
|
|
|
result, setup_output = update_cmd.exec_cmd_by_type(cinema_ip, 'setup', setup_list, short_release) |
|
|
|
|
|
|
|
if result is False: |
|
|
|
|
|
|
|
raise Exception(setup_output) |
|
|
|
cinema_update_status[cinema_ip]['setup']['result'] = 'success' |
|
|
|
cinema_update_status[cinema_ip]['setup']['result'] = 'success' |
|
|
|
cinema_update_status[cinema_ip]['setup']['msg'] = setup_output |
|
|
|
cinema_update_status[cinema_ip]['setup']['msg'] = setup_output |
|
|
|
except Exception as e: |
|
|
|
except Exception as e: |
|
|
@ -195,7 +197,9 @@ def update_cine(request): |
|
|
|
try: |
|
|
|
try: |
|
|
|
cinema_update_status[cinema_ip]['teardown']['result'] = 'running' |
|
|
|
cinema_update_status[cinema_ip]['teardown']['result'] = 'running' |
|
|
|
update_cmd = UpdateCommandUtil() |
|
|
|
update_cmd = UpdateCommandUtil() |
|
|
|
teardown_output = update_cmd.exec_cmd_by_type(cinema_ip, 'teardown', teardown_list, short_release) |
|
|
|
result, teardown_output = update_cmd.exec_cmd_by_type(cinema_ip, 'teardown', teardown_list, short_release) |
|
|
|
|
|
|
|
if result is False: |
|
|
|
|
|
|
|
raise Exception(teardown_output) |
|
|
|
cinema_update_status[cinema_ip]['teardown']['result'] = 'success' |
|
|
|
cinema_update_status[cinema_ip]['teardown']['result'] = 'success' |
|
|
|
cinema_update_status[cinema_ip]['teardown']['msg'] = '执行升级脚本:执行成功' |
|
|
|
cinema_update_status[cinema_ip]['teardown']['msg'] = '执行升级脚本:执行成功' |
|
|
|
except Exception as e: |
|
|
|
except Exception as e: |
|
|
@ -212,17 +216,17 @@ def update_cine(request): |
|
|
|
update_config = UpdateConfigUtil(cinema_ip, config_list, False) |
|
|
|
update_config = UpdateConfigUtil(cinema_ip, config_list, False) |
|
|
|
config_after_output = update_config.exec_config() |
|
|
|
config_after_output = update_config.exec_config() |
|
|
|
cinema_update_status[cinema_ip]['config']['result'] = 'success' |
|
|
|
cinema_update_status[cinema_ip]['config']['result'] = 'success' |
|
|
|
cinema_update_status[cinema_ip]['config']['msg'] = update_status['config']['msg'] + '\n' + config_after_output |
|
|
|
cinema_update_status[cinema_ip]['config']['msg'] = config_before_output + '<br/>' + config_after_output |
|
|
|
except Exception as e: |
|
|
|
except Exception as e: |
|
|
|
print('config', e) |
|
|
|
print('config', e) |
|
|
|
cinema_update_status[cinema_ip]['config']['result'] = 'fail' |
|
|
|
cinema_update_status[cinema_ip]['config']['result'] = 'fail' |
|
|
|
cinema_update_status[cinema_ip]['config']['msg'] = update_status['config']['msg'] + '\n' + str(e) |
|
|
|
cinema_update_status[cinema_ip]['config']['msg'] = config_before_output + '<br/>' + str(e) |
|
|
|
return JsonResponse({'result': 'fail', 'ip': cinema_ip, 'msg': str(e)}) |
|
|
|
return JsonResponse({'result': 'fail', 'ip': cinema_ip, 'msg': str(e)}) |
|
|
|
|
|
|
|
|
|
|
|
# 传输客户端 |
|
|
|
# 传输客户端 |
|
|
|
client_list = list(set(cmd_list) & set(cmd_dict['client'])) |
|
|
|
client_list = list(set(cmd_list) & set(cmd_dict['client'])) |
|
|
|
if len(client_list) > 0: |
|
|
|
if len(client_list) > 0: |
|
|
|
print('传输客户端') |
|
|
|
print('传输客户端1') |
|
|
|
try: |
|
|
|
try: |
|
|
|
client_release = ClientUtil() |
|
|
|
client_release = ClientUtil() |
|
|
|
client_release.client_process(cinema_ip, short_release) |
|
|
|
client_release.client_process(cinema_ip, short_release) |
|
|
|