From f35ce6d4850b5e9ff8f62abc72aea502109d01b9 Mon Sep 17 00:00:00 2001 From: Simon Rettberg Date: Mon, 31 Oct 2022 12:53:09 +0100 Subject: [statistics] Fake one HDD if machine has old-style sysinfo data If the machine never booted with the new JSON-style HW info reporting, we don't have any information about the number of HDDs in that system. These machines would show up with a red "missing HDD" icon in the machine list, which is bad. For now, if we have no meta data but know the machine has an ID44 partition, just assume the machine has one HDD. --- modules-available/statistics/pages/list.inc.php | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'modules-available/statistics/pages/list.inc.php') diff --git a/modules-available/statistics/pages/list.inc.php b/modules-available/statistics/pages/list.inc.php index 0e405bf5..1b6879e2 100644 --- a/modules-available/statistics/pages/list.inc.php +++ b/modules-available/statistics/pages/list.inc.php @@ -94,6 +94,10 @@ class SubPage } if (isset($machineWithHdds[$row['machineuuid']])) { $row['hddcount'] = $machineWithHdds[$row['machineuuid']]; + } else if ($row['id44mb'] > 0) { + // This might be a machine that wasn't booted with a recent system, and hence doesn't have HWinfo in DB + // If we have ID44 space in our main table, we most likely got an HDD, so fake a count of 1 + $row['hddcount'] = 1; } if (isset($row['data']) && !$row['data']) { $row['nohdd'] = true; -- cgit v1.2.3-55-g7522