# -*- coding:utf-8 -*-
#系统异常重启后工具重连次数
UPGRADE_REBOOT_AFTER_CONNECT_TIMES = 60
#系统异常重启后工具重连间隔时间
UPGRADE_REBOOT_AFTER_CONNECT_INTERVAL = 30
#分发包后状态轮询次数
UPLOAD_PACKAGE_POLL_TIMES = 27*6
#分发包后状态轮询间隔时间
UPLOAD_PACKAGE_POLL_INTERVAL = 10
#执行命令默认超时时间
CMD_DEFAULT_TIMEOUT = 60*5
#下发升级命令后状态轮询次数 
UPGRADE_PACKAGE_POLL_TIMES = 60*6
#下发升级命令后状态轮询间隔时间
UPGRADE_PACKAGE_POLL_INTERVAL = 10
#OM处理失败错误码
OM_OPERATE_FAIL_CODE = 1077949004
#补丁包安全上限，以Byte为单位
PATCH_SAFE_SIZE = 40 * 1024 * 1024

# 升级补丁进程完成后1分钟后会重启升级进程，这时可能导致下发给升级组的命令超时，设置超时时间为10S，并重试
AFTER_UPGRADE_RETRYTIMES = 3
AFTER_UPGRADE_INTERVAL = 5
AFTER_UPGRADE_TIMEOUT = 60

class OM_MSG_OP_UPD_LST_SYS_PROGRESS():
    #SSH: getConnection error code.
    UPD_READY = 0  #初始化状态
    UPD_DLDING = 4 #下载中
    UPD_DLD_SUCCESS = 5 #下载成功
    UPD_DLD_FAIL = 6 #下载失败
    UPD_UPDING = 10 #升级中
    UPD_UPD_SUCCESS = 11 #升级成功
    UPD_UPD_FAIL = 12 #升级失败 
    UPD_ROLLBACKING = 13 #回滚中
    UPD_ROLLBACK_SUCCESS = 14 #回滚成功
    UPD_ROLLBACK_FAIL = 15 #回滚失败   

class PATCH_TYPE():
    ASL_PATCH = 'ASL'
    HOT_PATCH = 'HOT'
    
class TLV_PACKAGE_TYPE():
    ASL_PATCH_PKG = 5
    HOT_PATCH_PKG = 3
class CMO_EXE_UPD_MSGTYPE():
    ASL_PATCH_MSGTYPE = 9
    HOT_PATCH_MSGTYPE = 7
class TLV_CMD():
    OM_MSG_OP_LST_VER = 8599109735
    EXC_UPD = 8599117931
    OM_MSG_OP_GET_PACKAGE_UPLOADPATH = 8599109754
    OM_MSG_OP_UPD_LST_SYS_PROGRESS = 8599109744
    OM_MSG_OP_NOTIFY_PACKAGE_PATH = 8599117947
    OM_MSG_OP_UPD_LIST_DETAILINFO = 8599150995
    

    