mirror of
https://github.com/Icinga/icingaweb2-module-director.git
synced 2025-07-31 01:34:12 +02:00
HostController: catch NestingError when...
...resolving agent property refs #11803
This commit is contained in:
parent
18882324ee
commit
628df65fd4
@ -4,6 +4,7 @@ namespace Icinga\Module\Director\Controllers;
|
|||||||
|
|
||||||
use Exception;
|
use Exception;
|
||||||
use Icinga\Exception\NotFoundError;
|
use Icinga\Exception\NotFoundError;
|
||||||
|
use Icinga\Module\Director\Exception\NestingError;
|
||||||
use Icinga\Module\Director\IcingaConfig\AgentWizard;
|
use Icinga\Module\Director\IcingaConfig\AgentWizard;
|
||||||
use Icinga\Module\Director\Objects\IcingaEndpoint;
|
use Icinga\Module\Director\Objects\IcingaEndpoint;
|
||||||
use Icinga\Module\Director\Objects\IcingaHost;
|
use Icinga\Module\Director\Objects\IcingaHost;
|
||||||
@ -24,14 +25,18 @@ class HostController extends ObjectController
|
|||||||
'urlParams' => array('name' => $this->object->object_name),
|
'urlParams' => array('name' => $this->object->object_name),
|
||||||
'label' => 'Services'
|
'label' => 'Services'
|
||||||
));
|
));
|
||||||
if ($this->object->object_type === 'object'
|
try {
|
||||||
&& $this->object->getResolvedProperty('has_agent') === 'y'
|
if ($this->object->object_type === 'object'
|
||||||
) {
|
&& $this->object->getResolvedProperty('has_agent') === 'y'
|
||||||
$tabs->add('agent', array(
|
) {
|
||||||
'url' => 'director/host/agent',
|
$tabs->add('agent', array(
|
||||||
'urlParams' => array('name' => $this->object->object_name),
|
'url' => 'director/host/agent',
|
||||||
'label' => 'Agent'
|
'urlParams' => array('name' => $this->object->object_name),
|
||||||
));
|
'label' => 'Agent'
|
||||||
|
));
|
||||||
|
}
|
||||||
|
} catch (NestingError $e) {
|
||||||
|
// Ignore nesting errors
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user