-- Copyright (c) 2024 Huawei Technologies Co., Ltd.
-- openUBMC is licensed under Mulan PSL v2.
-- You can use this software according to the terms and conditions of the Mulan PSL v2.
-- You may obtain a copy of Mulan PSL v2 at: http://license.coscl.org.cn/MulanPSL2
--
-- THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND,
-- EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT,
-- MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE.
-- See the Mulan PSL v2 for more details.

local hard_disk_list = Input

for i = 1, #hard_disk_list do
    -- 硬盘不在位absence(1)时，设置其他属性为默认值
    if hard_disk_list[i].hardDiskPresence == 1 then
        hard_disk_list[i].hardDiskStatus = 5
        hard_disk_list[i].hardDiskLocation = ''
        hard_disk_list[i].hardDiskFunction = ''
        hard_disk_list[i].hardDiskDevicename = ''
        hard_disk_list[i].hardDiskSerialNumber = ''
        hard_disk_list[i].hardDiskModelNumber = ''
        hard_disk_list[i].hardDiskManufacturer = ''
        hard_disk_list[i].hardDiskFwState = 255
        hard_disk_list[i].hardDiskFwVersion = ''
        hard_disk_list[i].hardDiskCapacityInGB = -1
        hard_disk_list[i].hardDiskMediaType = 255
        hard_disk_list[i].hardDiskInterfaceType = 255
        hard_disk_list[i].hardDiskPowerState = 255
        hard_disk_list[i].hardDiskRebuildProgress = 255
        hard_disk_list[i].hardDiskPatrolReadStatus = 255
        hard_disk_list[i].hardDiskCapableSpeedInMbps = -1
        hard_disk_list[i].hardDiskNegotiatedSpeedInMbps = -1
        hard_disk_list[i].hardDiskTemperature = 255
        hard_disk_list[i].hardDiskSASAddr1 = ''
        hard_disk_list[i].hardDiskSASAddr2 = ''
        hard_disk_list[i].hardDiskPrefailState = 255
        hard_disk_list[i].hardDiskHotSpareState = 255
        hard_disk_list[i].hardDiskRemnantWearout = 255
        hard_disk_list[i].hardDiskMediaErrCount = -1
        hard_disk_list[i].hardDiskPrefailErrCount = -1
        hard_disk_list[i].hardDiskOtherErrCount = -1
        hard_disk_list[i].hardDiskLocationState = 1
        hard_disk_list[i].hardDiskCapacityInMB = -1
        hard_disk_list[i].hardDiskPowerOnHours = -1
    end
end

return hard_disk_list