mirror of
https://github.com/Icinga/icinga2.git
synced 2025-09-24 10:17:59 +02:00
On ScheduledDowntime change: remove downtimes created before change
... to cause their re-creation with the ScheduledDowntime change taken into account. refs #8309
This commit is contained in:
parent
a93f269cab
commit
7874ed6436
@ -197,8 +197,33 @@ bool Downtime::HasValidConfigOwner() const
|
||||
return true;
|
||||
}
|
||||
|
||||
String configOwner = GetConfigOwner();
|
||||
return configOwner.IsEmpty() || Zone::GetByName(GetAuthoritativeZone()) != Zone::GetLocalZone() || GetObject<ScheduledDowntime>(configOwner);
|
||||
if (Zone::GetByName(GetAuthoritativeZone()) != Zone::GetLocalZone()) {
|
||||
return true;
|
||||
}
|
||||
|
||||
ScheduledDowntime::Ptr owner;
|
||||
|
||||
{
|
||||
auto configOwner (GetConfigOwner());
|
||||
|
||||
if (configOwner.IsEmpty()) {
|
||||
return true;
|
||||
}
|
||||
|
||||
owner = GetObject<ScheduledDowntime>(configOwner);
|
||||
|
||||
if (!owner) {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
auto configOwnerHash (GetConfigOwnerHash());
|
||||
|
||||
if (configOwnerHash.IsEmpty()) {
|
||||
return true;
|
||||
}
|
||||
|
||||
return configOwnerHash == owner->HashDowntimeOptions();
|
||||
}
|
||||
|
||||
int Downtime::GetNextDowntimeID()
|
||||
|
Loading…
x
Reference in New Issue
Block a user