mirror of
https://github.com/librenms/librenms.git
synced 2024-10-07 16:52:45 +00:00
Handle unexpected os when loading yaml (#9790)
This commit is contained in:
@ -1601,12 +1601,14 @@ function load_all_os($existing = false, $cached = true)
|
||||
}
|
||||
|
||||
foreach ($os_list as $file) {
|
||||
$tmp = Symfony\Component\Yaml\Yaml::parse(file_get_contents($file));
|
||||
if (is_readable($file)) {
|
||||
$tmp = Symfony\Component\Yaml\Yaml::parse(file_get_contents($file));
|
||||
|
||||
if (isset($config['os'][$tmp['os']])) {
|
||||
$config['os'][$tmp['os']] = array_replace_recursive($tmp, $config['os'][$tmp['os']]);
|
||||
} else {
|
||||
$config['os'][$tmp['os']] = $tmp;
|
||||
if (isset($config['os'][$tmp['os']])) {
|
||||
$config['os'][$tmp['os']] = array_replace_recursive($tmp, $config['os'][$tmp['os']]);
|
||||
} else {
|
||||
$config['os'][$tmp['os']] = $tmp;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user