From 42642c88d64111928b3578b7c45c2a7751e51a9c Mon Sep 17 00:00:00 2001 From: Johannes Meyer Date: Thu, 21 Feb 2019 11:35:16 +0100 Subject: [PATCH] BpConfig: Flag imported configurations --- library/Businessprocess/BpConfig.php | 20 +++++++++++++++++++- 1 file changed, 19 insertions(+), 1 deletion(-) diff --git a/library/Businessprocess/BpConfig.php b/library/Businessprocess/BpConfig.php index 7295508..cfa5268 100644 --- a/library/Businessprocess/BpConfig.php +++ b/library/Businessprocess/BpConfig.php @@ -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();