diff options
author | Simon Rettberg | 2022-10-31 12:51:13 +0100 |
---|---|---|
committer | Simon Rettberg | 2022-10-31 12:51:13 +0100 |
commit | 332d307fa855bf01779765e1f974c6524c26f592 (patch) | |
tree | b9f4e59a967a547f63f2d8113a5d9a1d344f2c4d /modules-available/statistics/inc | |
parent | [serversetup-bwlp-ipxe] Encode ipxe script depending on iPXE version (diff) | |
download | slx-admin-332d307fa855bf01779765e1f974c6524c26f592.tar.gz slx-admin-332d307fa855bf01779765e1f974c6524c26f592.tar.xz slx-admin-332d307fa855bf01779765e1f974c6524c26f592.zip |
[statistics] Deal with broken HDDs that lead to incomplete data
We had a machine with a broken HDD that showed up as /dev/sda but didn't
do much else, confusing tools like lsblk and fdisk, and ultimately
leading to incomplete data in our DB that would make PHP freak out too
much about missing array indices and wrong types.
Diffstat (limited to 'modules-available/statistics/inc')
-rw-r--r-- | modules-available/statistics/inc/hardwareparser.inc.php | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/modules-available/statistics/inc/hardwareparser.inc.php b/modules-available/statistics/inc/hardwareparser.inc.php index 565c9a54..bfb603ce 100644 --- a/modules-available/statistics/inc/hardwareparser.inc.php +++ b/modules-available/statistics/inc/hardwareparser.inc.php @@ -480,7 +480,7 @@ class HardwareParser // smartctl didn't report on it, lsblk says it's non-rotational $smart['rotation_rate'] = 0; } - $size = $lsblk['size'] ?? $smart['user_capacity']['bytes'] ?? 'unknown'; + $size = $lsblk['size'] ?? $smart['user_capacity']['bytes'] ?? -1; // Don't change the global props, it would change the HW ID $hwid = self::writeGlobalHardwareData(HardwareInfo::HDD, [ // Try to use the model name as the unique identifier |