summaryrefslogtreecommitdiffstats
path: root/modules-available/statistics/pages
diff options
context:
space:
mode:
authorSimon Rettberg2022-10-31 12:53:09 +0100
committerSimon Rettberg2022-10-31 12:53:09 +0100
commitf35ce6d4850b5e9ff8f62abc72aea502109d01b9 (patch)
tree95b22d4509f77dd8e8f4e9ff91a31bf88138d775 /modules-available/statistics/pages
parent[statistics] Deal with broken HDDs that lead to incomplete data (diff)
downloadslx-admin-f35ce6d4850b5e9ff8f62abc72aea502109d01b9.tar.gz
slx-admin-f35ce6d4850b5e9ff8f62abc72aea502109d01b9.tar.xz
slx-admin-f35ce6d4850b5e9ff8f62abc72aea502109d01b9.zip
[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.
Diffstat (limited to 'modules-available/statistics/pages')
-rw-r--r--modules-available/statistics/pages/list.inc.php4
1 files changed, 4 insertions, 0 deletions
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;