Skip to content

Commit f2b7098

Browse files
committed
fix: Update sysObjectID partial matching algorithm
1 parent d493d72 commit f2b7098

File tree

1 file changed

+12
-0
lines changed

1 file changed

+12
-0
lines changed

lib/GLPI/Agent/Tools/Hardware.pm

+12
Original file line numberDiff line numberDiff line change
@@ -405,6 +405,18 @@ sub _getSysObjectIDInfo {
405405
}
406406

407407
# fallback to partial match
408+
while (my ($device_partial_id) = $device_id =~ /^(\d+.*)\.\d+$/) {
409+
$match = $sysobjectid{$manufacturer_id . '.' . $device_partial_id};
410+
if ($match) {
411+
$logger->debug(
412+
"partial match for sysobjectID $params{id} on partial SysObject ID"
413+
) if $logger;
414+
return $match;
415+
}
416+
$device_id = $device_partial_id;
417+
}
418+
419+
# fallback to partial match on manufacturer only
408420
$match = $sysobjectid{$manufacturer_id};
409421
if ($match) {
410422
$logger->debug(

0 commit comments

Comments
 (0)