IcingaDependency: drop parent_service_var

This commit is contained in:
Thomas Gelf 2019-07-08 13:17:08 +02:00
parent bb9105e370
commit 01f2666ff2
3 changed files with 2 additions and 23 deletions

View File

@ -94,7 +94,6 @@ class IcingaDependencyForm extends DirectorObjectForm
'description' => $this->translate(
'Whether this dependency should affect hosts or services'
),
'required' => true,
'class' => 'autosubmit',
'multiOptions' => $this->optionalEnum([
'host' => $this->translate('Hosts'),
@ -209,9 +208,6 @@ class IcingaDependencyForm extends DirectorObjectForm
if (!empty($sentParent) || $dependency->isApplyRule()) {
$parentService = $dependency->get('parent_service');
if ($parentService === null) {
$parentService = $dependency->get('parent_service_var');
}
$this->addElement('text', 'parent_service', [
'label' => $this->translate('Parent Service'),
'description' => $this->translate(

View File

@ -23,7 +23,6 @@ class IcingaDependency extends IcingaObject implements ExportInterface
'parent_host_id' => null,
'parent_host_var' => null,
'parent_service_id' => null,
'parent_service_var' => null,
'child_host_id' => null,
'child_service_id' => null,
'disable_checks' => null,
@ -446,24 +445,9 @@ class IcingaDependency extends IcingaObject implements ExportInterface
);
}
/**
* Render parent_service_var as parent_service_name
* @codingStandardsIgnoreStart
*
* @return string
*/
public function renderParent_service_var()
{
// @codingStandardsIgnoreEnd
return c::renderKeyValue(
'parent_service_name',
$this->get('parent_host_var')
);
}
//
/**
* Render parent_service_var as parent_service_name
* Render parent_service_by_name as parent_service_name
*
* Special case for parent service set as plain string for Apply rules
*
@ -501,7 +485,7 @@ class IcingaDependency extends IcingaObject implements ExportInterface
# related services need array key
if ($class === IcingaService::class) {
if ($name === 'parent_service_id' && $this->object_type === 'apply') {
if ($name === 'parent_service_id' && $this->get('object_type') === 'apply') {
//special case , parent service can be set as simple string for Apply
if ($this->properties['parent_host_id'] === null) {
$this->reallySet(

View File

@ -1675,7 +1675,6 @@ CREATE TABLE icinga_dependency (
parent_host_id INT(10) UNSIGNED DEFAULT NULL,
parent_host_var VARCHAR(128) DEFAULT NULL,
parent_service_id INT(10) UNSIGNED DEFAULT NULL,
parent_service_var VARCHAR(128) DEFAULT NULL,
child_host_id INT(10) UNSIGNED DEFAULT NULL,
child_service_id INT(10) UNSIGNED DEFAULT NULL,
disable_checks ENUM('y', 'n') DEFAULT NULL,