diff --git a/update/views.py b/update/views.py index 3d2ad00..8bc268b 100644 --- a/update/views.py +++ b/update/views.py @@ -183,7 +183,7 @@ def update_cine(request): update_status['git']['msg'] = str(e) redis_conn.set(redis_key, json.dumps(update_status), 5 * 60) # redis_conn.delete(redis_key) - UpdateLog.objects.create(ip=cinema_ip, type='toolbox', origin_ver=org_ver, target_ver=short_release, + UpdateLog.objects.create(ip=cinema_ip, type='toolbox', origin_ver=org_ver, target_ver=short_release[:11], time=update_time, result=update_status['result'], result_detail=json.dumps(update_status)) return JsonResponse({'result': 'fail', 'ip': cinema_ip, 'msg': str(e)}) @@ -209,7 +209,7 @@ def update_cine(request): update_status['setup']['msg'] = str(e) redis_conn.set(redis_key, json.dumps(update_status), 5 * 60) # redis_conn.delete(redis_key) - UpdateLog.objects.create(ip=cinema_ip, type='toolbox', origin_ver=org_ver, target_ver=short_release, + UpdateLog.objects.create(ip=cinema_ip, type='toolbox', origin_ver=org_ver, target_ver=short_release[:11], time=update_time, result=update_status['result'], result_detail=json.dumps(update_status)) return JsonResponse({'result': 'fail', 'ip': cinema_ip, 'msg': str(e)}) @@ -233,7 +233,7 @@ def update_cine(request): update_status['sql']['msg'] = str(e) redis_conn.set(redis_key, json.dumps(update_status), 5 * 60) # redis_conn.delete(redis_key) - UpdateLog.objects.create(ip=cinema_ip, type='toolbox', origin_ver=org_ver, target_ver=short_release, + UpdateLog.objects.create(ip=cinema_ip, type='toolbox', origin_ver=org_ver, target_ver=short_release[:11], time=update_time, result=update_status['result'], result_detail=json.dumps(update_status)) return JsonResponse({'result': 'fail', 'ip': cinema_ip, 'msg': str(e)}) @@ -256,7 +256,7 @@ def update_cine(request): update_status['config']['msg'] = str(e) redis_conn.set(redis_key, json.dumps(update_status), 5 * 60) # redis_conn.delete(redis_key) - UpdateLog.objects.create(ip=cinema_ip, type='toolbox', origin_ver=org_ver, target_ver=short_release, + UpdateLog.objects.create(ip=cinema_ip, type='toolbox', origin_ver=org_ver, target_ver=short_release[:11], time=update_time, result=update_status['result'], result_detail=json.dumps(update_status)) return JsonResponse({'result': 'fail', 'ip': cinema_ip, 'msg': str(e)}) @@ -282,7 +282,7 @@ def update_cine(request): update_status['teardown']['msg'] = str(e) redis_conn.set(redis_key, json.dumps(update_status), 5 * 60) # redis_conn.delete(redis_key) - UpdateLog.objects.create(ip=cinema_ip, type='toolbox', origin_ver=org_ver, target_ver=short_release, + UpdateLog.objects.create(ip=cinema_ip, type='toolbox', origin_ver=org_ver, target_ver=short_release[:11], time=update_time, result=update_status['result'], result_detail=json.dumps(update_status)) return JsonResponse({'result': 'fail', 'ip': cinema_ip, 'msg': str(e)}) @@ -305,7 +305,7 @@ def update_cine(request): update_status['config']['msg'] = config_before_output + '
' + str(e) redis_conn.set(redis_key, json.dumps(update_status), 5 * 60) # redis_conn.delete(redis_key) - UpdateLog.objects.create(ip=cinema_ip, type='toolbox', origin_ver=org_ver, target_ver=short_release, + UpdateLog.objects.create(ip=cinema_ip, type='toolbox', origin_ver=org_ver, target_ver=short_release[:11], time=update_time, result=update_status['result'], result_detail=json.dumps(update_status)) return JsonResponse({'result': 'fail', 'ip': cinema_ip, 'msg': str(e)}) @@ -330,7 +330,7 @@ def update_cine(request): update_status['client']['msg'] = str(e) redis_conn.set(redis_key, json.dumps(update_status), 5 * 60) # redis_conn.delete(redis_key) - UpdateLog.objects.create(ip=cinema_ip, type='toolbox', origin_ver=org_ver, target_ver=short_release, + UpdateLog.objects.create(ip=cinema_ip, type='toolbox', origin_ver=org_ver, target_ver=short_release[:11], time=update_time, result=update_status['result'], result_detail=json.dumps(update_status)) return JsonResponse({'result': 'fail', 'ip': cinema_ip, 'msg': str(e)})