BpConfig: Flag imported configurations

This commit is contained in:
Johannes Meyer 2019-02-21 11:35:16 +01:00
parent 431a5e0085
commit 42642c88d6

View file

@ -3,7 +3,6 @@
namespace Icinga\Module\Businessprocess;
use Exception;
use LogicException;
use Icinga\Application\Config;
use Icinga\Exception\IcingaException;
use Icinga\Exception\NotFoundError;
@ -89,6 +88,13 @@ class BpConfig
*/
protected $root_nodes = array();
/**
* Whether this configuration has been imported
*
* @var bool
*/
protected $imported = false;
/**
* Imported nodes
*
@ -552,6 +558,17 @@ class BpConfig
return $missing;
}
public function setImported($state = true)
{
$this->imported = (bool) $state;
return $this;
}
public function isImported()
{
return $this->imported;
}
public function createImportedNode($config, $name = null)
{
$params = (object) array('configName' => $config);
@ -569,6 +586,7 @@ class BpConfig
{
if (! isset($this->importedConfigs[$name])) {
$import = $this->storage()->loadProcess($name);
$import->setImported();
if ($this->usesSoftStates()) {
$import->useSoftStates();