# -*- coding:utf-8 -*-
#系统异常重启后工具重连次数
UPGRADE_REBOOT_AFTER_CONNECT_TIMES = 90
#系统异常重启后工具重连间隔时间
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*2
#下发升级命令后状态轮询间隔时间
UPGRADE_PACKAGE_POLL_INTERVAL = 10
#OM处理失败错误码
OM_OPERATE_FAIL_CODE = 1077949004
#补丁包安全上限，以Byte为单位
PATCH_SAFE_SIZE = 70 * 1024 * 1024

# V5R7C60SPC100基线版本没有swm补丁自升级机制，会在升级后1分钟重启升级进程，可能会导致检查项异常。
# 故补丁后检查需要增加睡眠时间60+10（进程拉起时间）
NEED_SLEEP_VERSION = "V500R007C60SPC100 Kunpeng"
NEED_SLEEP_TIME = 70

# 补丁评估
PATCH_EVALU = 'PATCH_EVALU'

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'
    PATCH_EVALU = 'PATCH_EVALU'

class TLV_PACKAGE_TYPE():
    ASL_PATCH_PKG = 5
    HOT_PATCH_PKG = 3
    SYS_UPGRADE_PKG = 1#系统升级包类型

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
    GET = 55834574848

class TLV_OM_OBJ_E():
    SYSTEM = 201

class ProductModelType():
    typeMap = {'S2200T':'T',
               'S2600T':'T',
               'S5500T':'T',
               'S5600T':'T',
               'S5800T':'T',
               'S6800T':'T',
               '5300V3':'V3',
               '5500V3':'V3',
               '5600V3':'V3',
               '5800V3':'V3',
               '6800V3':'V3',
               '6900V3':'V3',
               'Dorado5000':'V3',
               'Dorado6000':'V3',
               'Dorado18000 V3':'V3',
               'HVS_18500':'18000',
               'HVS_18800':'18000',
               'HVS_18800F':'18000',
               'HVS85T':'18000',
               'HVS88T':'18000',
               '2600FV3':'V3',
               '5500FV3':'V3',
               '5600FV3':'V3',
               '5800FV3':'V3',
               '6800FV3':'V3',
               '18500FV3':'18000',
               '18800FV3':'18000',
               '2200 V3 Enhanced':'V3',
               '2600 V3 Enhanced':'V3',
               '2600F V3 Enhanced':'V3',
               '5300 V5 Enhanced':'V5',
              }
