#  coding=UTF-8
#  Copyright (c) Huawei Technologies Co., Ltd. 2019-2024. All rights reserved.

"""
@time: 2020/09/22
@file: resource.py
@function:
"""

MESSAGES_DICT = {
    "check.disk.singlelink.notpass":
        {
            "zh": u"控制器[%s]:磁盘单链路检查不通过，不允许打补丁",
            "en": "Disk single link of controller [%s] check not pass, patch"
                  " can not be performed.",
        },
    "check.disk.singlelink.pass":
        {
            "zh": u"控制器[%s]:磁盘单链路检查通过",
            "en": "The disk single link of controller [%s] check pass.",
        },
    "check.result.timeout":
        {
            "zh": u"控制器检查结果超时",
            "en": "The controller check times out.",
        },
    "check.power.bbu.alarm.pre":
        {
            "zh": u"请按照告警修复建议进行处理。",
            "en": "Rectify the fault according to the alarm handling suggestions.",
        },
    "check.power.bbu.alarm.after":
        {
            "zh": u"BBU固件版本与阵列软件不兼容。请等待BBU绿灯常亮时，拔出BBU等待30S再插入BBU，"
                  u"约2分钟后“BBU固件版本与阵列软件不兼容”告警会自动恢复，按此操作依次插拔BBU，即可恢复告警。",
            "en": "The BBU firmware is incompatible with storage array software. "
                  "Wait until the BBU indicator is steady green, remove a BBU, "
                  "wait for 30 seconds, and then insert the BBU. About 2 minutes later, "
                  "alarm \"BBU Firmware Is Incompatible With Storage Array Software\" is automatically cleared. "
                  "Remove and reinstall the other BBUs in sequence to clear all the alarms.",
        },
    "check.power.bbu.alarm.after.minisystem":
        {
            "zh": u"BBU固件版本与阵列软件不兼容。"
                  u"请使用超级管理员用户登录设备，确认告警BBU所在的控制框，对框上的所有控制器依次执行"
                  u"小系统命令eam.sh upgradebbufw starteam升级BBU固件，"
                  u"待BBU固件升级成功后，“BBU固件版本与阵列软件不兼容”告警自动恢复。",
            "en": "The BBU firmware version is incompatible with the storage array software. "
                  "Log in to the device as a super administrator and locate the controller enclosure "
                  "where the alarm BBU resides. Run the eam.sh upgradebbufw starteam command on all controllers "
                  "in the enclosure one by one to upgrade the BBU. After the BBU is successfully upgraded, "
                  "alarm \"BBU Firmware Is Incompatible With Storage Array Software\" is automatically cleared.",
        },
    "check.bbu.model.fault.alarm.after":
        {
            "zh": u"BBU模块故障告警(Alarm ID:0xF00D2001C)被误屏蔽，工具取消屏蔽失败，请使用超级管理员用户登录设备，"
                  u"执行change alarm_mask alarm_id_list=0xF00D2001C mask_switch=off命令手动取消屏蔽。",
            "en": "The BBU fault alarm (Alarm ID: 0xF00D2001C) is incorrectly masked. "
                  "The tool fails to unmask the alarm. "
                  "Log in to the device as a super administrator and run the "
                  "change alarm_mask alarm_id_list=0xF00D2001C mask_switch=off command to manually unmask the alarm.",
        },
    "check.components.abnormal.alarm.after":
        {
            "zh": u"BBU升级过程中误报内部组件异常告警(Alarm ID: 0xF00C90150)，该误报对设备无影响，"
                  u"请搜集系统日志并联系技术工程师评估后，再删除该告警。",
            "en": "During the BBU upgrade, alarm \"Components In The System Are Abnormal Internal Component Fault "
                  "(Alarm ID: 0xF00C90150)\" is falsely reported, which has no impact on the device. "
                  "Collect system logs and contact technical support engineers for evaluation. "
                  "Then, delete this alarm.",
        },
    "check.power.bbu.status.fail":
        {
            "zh": u"BBU的健康状态不为Normal，请更换BBU模块。",
            "en": "If the health status of the BBU is not Normal, replace the BBU.",
        },
    "check.power.bbu.online_testing":
        {
            "zh": u"当前BBU正处于充放电状态，不能进行BBU升级。",
            "en": "The BBU is being charged or discharged and cannot be upgraded.",
        },
    "check.power.bbu.online_testing.next_date":
        {
            "zh": u"最近一次BBU在线测试时间为%s，当前系统时间为%s，下一次在线测试时间预计为%s至%s，请避开该时间区间完成BBU升级。",
            "en": "The latest BBU online test time is %s. "
                  "The current system time is %s. "
                  "The next online test time is estimated to be from %s to %s. "
                  "Do not upgrade the BBU during this period.",
        },
    "check.power.bbu.online_testing.next_date.null":
        {
            "zh": u"未获取到最近一次BBU在线测试时间，无法预估下一次在线测试时间。请搜集系统日志并联系技术工程师。",
            "en": "The latest BBU online test time is not obtained, and the next online test time cannot be estimated. "
                  "Collect system logs and contact technical support engineers.",
        },
    "check.power.bbu.super_admin_abnormal.interception":
        {
            "zh": u"超级管理员账号状态异常，该异常可能导致补丁安装失败，请重置密码后再安装补丁。",
            "en": "The super administrator account status is abnormal, which may affect the patch installation. "
                  "Reset the password and then upgrade the patch.",
        },
    "check.power.bbu.user_name_err.interception":
        {
            "zh": u"用户名称包含root关键字时会影响补丁安装，请删除该用户后再安装补丁（补丁安装成功后再重新创建该用户），"
                  u"或者安装V500R007C61SPH070及其之后的补丁版本。",
            "en": "If a user name contains the keyword root, patch installation will be affected. "
                  "Delete the user and then install the patch (create the user after the patch is successfully "
                  "installed), or install V500R007C61SPH070 or a later patch version.",
        },
    "check.power.bbu.super_admin_abnormal.suggestion":
        {
            "zh": u"超级管理员账号状态异常，该异常可能会影响BBU补丁升级，建议重置密码后再安装补丁。"
                  u"若不重置密码，补丁安装过程中可能会产生BBU模块故障告警，升级完成后告警自动恢复，该告警对设备无影响。",
            "en": "The super administrator account status is abnormal, which may affect the BBU patch upgrade. "
                  "You are advised to reset the password before installing the patch. "
                  "If you do not reset the password, "
                  "the BBU module fault alarm may be generated during patch installation. "
                  "After the upgrade is complete, the alarm is automatically cleared. "
                  "This alarm has no adverse impact on devices.",
        },
    "check.power.bbu.component_alarm_risk.suggestion":
        {
            "zh": u"多引擎设备安装%s补丁存在概率性报系统内部有部件工作异常告警（Alarm ID: 0xF00C90150）的风险（该告警对设备无影响），"
                  u"建议安装V500R007C61SPH070及其之后的补丁版本。",
            "en": "After the %s patch is installed on a multi-engine device, there is a possibility "
                  "that the alarm (0xF00C90150) indicating that a component in the system is abnormal is reported. "
                  "(This alarm does not affect the device.) "
                  "You are advised to install V500R007C61SPH070 or a later patch.",
        },
    "query.result.abnormal":
        {
            "zh": u"获取信息失败",
            "en": "There is an error in getting information",
        },
    "login.clis.overrun.info":
        {
            "zh": u"剩余内存不足，或者当前阵列登录数量已经超过允许的连接最大数，连接失败。请退出部分CLI或者释放部分内存后重试。",
            "en": "The connection fails because the available memory capacity is insufficient or the number of "
                  "connections reaches the maximum number. Quit one or more logged-in CLIs, "
                  "or release some memory and try again.",
        },
    "check.result.abnormal":
        {
            "zh": u"控制器[%s]:检查结果异常",
            "en": "Execution abnormal of controller [%s]",
        },
    "ndmp.service.get.vstore.id.error":
        {
            "zh": u"获取租户信息失败。",
            "en": "Failed to query vStore information.",
        },
    "ndmp.service.get.ndmp.service.error":
        {
            "zh": u"获取系统视图NDMP服务信息失败。",
            "en": "Failed to query the NDMP service of the system.",
        },
    "ndmp.service.get.info.error.tenant":
        {
            "zh": u"获取租户视图（租户ID：%s）NDMP服务失败。",
            "en": "Failed to query the NDMP service of vStores (IDs: %s).",
        },
    "ndmp.service.enable.sys":
        {
            "zh": u"系统视图NDMP服务开启。",
            "en": "The NDMP service is enabled for the system.",
        },
    "ndmp.service.enable.tenant":
        {
            "zh": u"租户视图（租户ID：%s）NDMP服务开启。",
            "en": "The NDMP service is enabled for vStores (IDs: %s).",
        },
    "ndmp.service.sugg":
        {
            "zh": u"影响：NDMP服务开启，安装热补丁过程中NDMP业务会中断。"
                  u"\n建议在无NDMP业务的时间窗内安装热补丁。",
            "en": "After the NDMP service is enabled, NDMP services will be "
                  "interrupted during hot patch installation.\nTherefore, you "
                  "are advised to install a hot patch when no NDMP service "
                  "is running.",
        },
    "ndmp.service.check.error":
        {
            "zh": u"NDMP服务启动状态检查失败。",
            "en": "Failed to check whether the NDMP service is enabled "
                  "or disabled.",
        },
    "upload.patch.pkg.timeout":
        {
            "zh": u"上传补丁包超时，请重试。",
            "en": "Uploading the patch package timed out, please try again.",
        },
    "power.patch.upgrade.suggestion":
        {
            "zh": u"当前环境电源模块处于升级状态，请勿操作电源，请联系技术支持工程师处理。修复建议：\n"
                  u"方案1：\n"
                  u"等待电源升级完成再进行工具操作。检查补丁安装时间，如果补丁安装时间在2h+20min*框数量，通过查询电源升级进度文件确认电源是否完成升级。\n"
                  u"操作方式：在0号控制器A节点，进入minisystem模式，执行命令eam.sh psu_upgrade_progress_query。\n"
                  u"方案2：\n"
                  u"步骤1：手动停止电源升级。操作方式：在控制器0A节点，进入minisystem模式，执行命令eam.sh psu_upgrade_prohibit on，等待时间60s；\n"
                  u"步骤2：完成补丁升级；\n"
                  u"步骤3：重新启动电源升级。操作方式：在控制器0A节点，进入minisystem模式，执行命令eam.sh psu_upgrade_prohibit off。\n",
            "en": "The PSU is being upgraded. Do not operate the PSU and contact Technical Support. "
                  "Rectification suggestions:\n"
                  "Solution 1:\n"
                  "Wait until the PSU upgrade is complete and then perform operations on the tool. Check the patch "
                  "installation time. If the patch installation time is equal to 2 hours + 20 minutes x Number of "
                  "subracks, query the PSU upgrade progress file to check whether the PSU upgrade is complete.\n"
                  "Operation method: On controller 0A node, enter the minisystem mode and run the "
                  "eam.sh psu_upgrade_progress_query command.\n"
                  "Solution 2:\n"
                  "Step 1: Manually stop the PSU upgrade. Operation method: On controller 0A, enter the minisystem "
                  "mode and run the eam.sh psu_upgrade_prohibit on command. Wait for 60s.\n"
                  "Step 2: Complete the patch upgrade.\n"
                  "Step 3: Restart the power supply upgrade. Operation method: On controller 0A, enter the minisystem "
                  "mode and run the eam.sh psu_upgrade_prohibit off command.\n",
        },
    "power.patch.upgrade.alarm":
        {
            "zh": u"待安装补丁存在电源固件升级，当前环境存在影响电源固件升级相关告警，需要告警消除后才能升级电源固件，请根据告警提示修复告警。\n"
                  u"若确认告警为误告警，请删除误告警再执行评估。\n"
                  u"若存在疑问，请联系技术支持工程师处理。\n",
            "en": "The PSU firmware is being upgraded. Alarms that affect the PSU firmware upgrade are generated in "
                  "the current environment. The PSU firmware can be upgraded only after the alarm is cleared. "
                  "Clear the alarm according to the alarm information.\n"
                  "If the alarm is a false alarm, delete the false alarm and perform the evaluation again.\n"
                  "If you have any questions, contact technical support engineers. \n",
        },
    "power.patch.upgrade.admin":
        {
            "zh": u"待安装补丁需要admin超级管理员用户权限，当前环境不支持，请更换新补丁进行升级。\n",
            "en": "The patch to be installed requires the admin super administrator rights, which is not supported "
                  "in the current environment. Use a new patch to upgrade the patch.\n",
        },
    "check.systemdisk.risk.not.pass":
        {
            "zh": u"当前设备以下控制器存在系统盘风险，请联系技术支持工程师处理：\n",
            "en": "The following controllers have system disk risks. Contact technical support engineers.\n",
        },
}
