IcingaNotification: separate times.begin/end

fixes #2193
This commit is contained in:
Thomas Gelf 2020-11-30 08:11:25 +01:00
parent c273a20ce4
commit 12a818216c
2 changed files with 3 additions and 31 deletions

View File

@ -74,6 +74,7 @@ next (will be 1.8.0)
### Icinga Configuration
* FIX: Correctly render Service Dependencies with Array-style parent hosts (#2088)
* FIX: times.begin and times.end are now rendered separately (#2193)
* REMOVED: magic-apply-for (a hidden deprecated feature) has been removed (#1851)
### Icinga Agent handling

View File

@ -69,52 +69,23 @@ class IcingaNotification extends IcingaObject implements ExportInterface
}
/**
* We have distinct properties in the db
*
* ...but render times only once
*
* And we skip warnings about underscores in method names:
* @codingStandardsIgnoreStart
*
* @return string
*/
protected function renderTimes_begin()
{
// @codingStandardsIgnoreEnd
$times = (object) [
'begin' => c::renderInterval($this->times_begin)
];
if ($this->get('times_end') !== null) {
$times->end = c::renderInterval($this->get('times_end'));
}
return c::renderKeyValue('times', c::renderDictionary($times));
return c::renderKeyValue('times.begin', c::renderInterval($this->get('times_begin')));
}
/**
* We have distinct properties in the db
*
* ...but render times only once
*
* And we skip warnings about underscores in method names:
* @codingStandardsIgnoreStart
*
* @return string
*/
protected function renderTimes_end()
{
// @codingStandardsIgnoreEnd
if ($this->get('times_begin') !== null) {
return '';
}
$times = (object) [
'end' => c::renderInterval($this->get('times_end'))
];
return c::renderKeyValue('times', c::renderDictionary($times));
return c::renderKeyValue('times.end', c::renderInterval($this->get('times_end')));
}
public function getUniqueIdentifier()