mirror of
https://github.com/Icinga/icingaweb2-module-businessprocess.git
synced 2025-12-24 16:49:34 -05:00
LegacyStorage: throw error on incomplete imports
This commit is contained in:
parent
898576f63a
commit
047e9dd70d
1 changed files with 13 additions and 4 deletions
|
|
@ -463,10 +463,19 @@ class LegacyStorage extends Storage
|
|||
$bp->createService($host, $service);
|
||||
}
|
||||
}
|
||||
if ($val[0] === '@' && strpos($val, ':') !== false) {
|
||||
list($config, $nodeName) = preg_split('~:\s*~', substr($val, 1), 2);
|
||||
$bp->createImportedNode($config, $nodeName);
|
||||
$val = $nodeName;
|
||||
if ($val[0] === '@') {
|
||||
if (strpos($val, ':') === false) {
|
||||
throw new ConfigurationError(
|
||||
"I'm unable to import full external configs, a node needs to be provided for '%s'",
|
||||
$val
|
||||
);
|
||||
// TODO: this might work:
|
||||
// $node = $bp->createImportedNode(substr($val, 1));
|
||||
} else {
|
||||
list($config, $nodeName) = preg_split('~:\s*~', substr($val, 1), 2);
|
||||
$node = $bp->createImportedNode($config, $nodeName);
|
||||
}
|
||||
$val = $node->getName();
|
||||
}
|
||||
|
||||
$childNames[] = $val;
|
||||
|
|
|
|||
Loading…
Reference in a new issue