
{
    "name"  : "热补丁检查-检查热补丁升级是否成功",
    "precondition" : ["isFix"],
    "problems" : {
        "patch_cm" : {
            "desc"      : "【问题】${0}",
            "advice"    : "【建议】若修复成功，建议再进行一次检测，验证检测升级结果是否成功，失败则再进行一次修复，若再不行则反馈给后台进行处理。"
        },
		"patch_lc" : {
            "desc"      : "【问题】${0}",
            "advice"    : "【建议】若修复成功，建议再进行一次检测，验证检测升级结果是否成功，失败则再进行一次修复，若再不行则反馈给后台进行处理。"
        },
		"patch_fw" : {
            "desc"      : "【问题】${0}。",
            "advice"    : "【建议】若修复成功，建议再进行一次检测,修复失败则联系后台进行处理。"
        },
		"patch_precondition" : {
            "desc"      : "【问题】${0}",
            "advice"    : "【建议】${1}。"
        }
    }
}

---------------------------code-------------------------------
isFixed = precondition('isFix')
#if !isFixed || isFixed == undefined :
#	add_reason('不同意直接打热补丁，跳过执行')
#	return 'skip'
#end
#if !isRunningInToolkit():
#	add_reason('非工具端环境，不支持此项检测')
#	return 'skip'
#end
#log_version = cli('show version detail')
#log_versionList = log_version.split('\r\n')
#if log_version.indexOf('11.0(4)B1') == -1 && log_version.indexOf('11.0(4)B2') == -1:
#	add_reason('非PJ5/PJ6版本，不进行检测')
#	return 'skip'
#end
result = 'pass'
result_precondition = get_share_value('precondition_result')
message_precondition = get_share_value('precondition_message')
message_precondition_advice = get_share_value('precondition_message_advice')
result_cm = get_share_value('cm_result')
message_cm = get_share_value('cm_message')
result_lc = get_share_value('lc_result')
message_lc = get_share_value('lc_message')
result_fw = get_share_value('fw_result')
message_fw = get_share_value('fw_message')

if result_precondition == 'fail':
    add_problem('patch_precondition',[message_precondition,message_precondition_advice])
	result = 'fail'
end
if result_cm == 'fail':
    add_problem('patch_cm',[message_cm])
	result = 'fail'
end
if result_lc == 'fail':
    add_problem('patch_lc',[message_lc])
	result = 'fail'
end
if result_fw == 'fail':
    add_problem('patch_fw',[message_fw])
	result = 'fail'
end

if result == 'fail':
    change_title('检测到热补丁相关问题，请根据具体结果进行操作')
	return 'warn'
end

return 'success'


