mirror of
https://github.com/Icinga/icingaweb2-module-businessprocess.git
synced 2025-12-24 00:29:47 -05:00
BpConfig: Process node imports in hasNode() and getNode()
This commit is contained in:
parent
42642c88d6
commit
f0162278d6
1 changed files with 8 additions and 0 deletions
|
|
@ -454,6 +454,9 @@ class BpConfig
|
||||||
{
|
{
|
||||||
if (array_key_exists($name, $this->nodes)) {
|
if (array_key_exists($name, $this->nodes)) {
|
||||||
return true;
|
return true;
|
||||||
|
} elseif ($name[0] === '@') {
|
||||||
|
list($configName, $nodeName) = preg_split('~:\s*~', substr($name, 1), 2);
|
||||||
|
return $this->getImportedConfig($configName)->hasNode($nodeName);
|
||||||
}
|
}
|
||||||
|
|
||||||
return false;
|
return false;
|
||||||
|
|
@ -645,6 +648,11 @@ class BpConfig
|
||||||
return $this->nodes[$name];
|
return $this->nodes[$name];
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if ($name[0] === '@') {
|
||||||
|
list($configName, $nodeName) = preg_split('~:\s*~', substr($name, 1), 2);
|
||||||
|
return $this->getImportedConfig($configName)->getNode($nodeName);
|
||||||
|
}
|
||||||
|
|
||||||
// Fallback: if it is a service, create an empty one:
|
// Fallback: if it is a service, create an empty one:
|
||||||
$this->warn(sprintf('The node "%s" doesn\'t exist', $name));
|
$this->warn(sprintf('The node "%s" doesn\'t exist', $name));
|
||||||
$pos = strpos($name, ';');
|
$pos = strpos($name, ';');
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue