mirror of
https://github.com/Icinga/icinga2.git
synced 2025-07-20 12:14:44 +02:00
Merge pull request #6821 from Icinga/bugfix/downtimes-disappear-satellite-6542
Don't delete downtimes in satellite zones
This commit is contained in:
commit
c4d57afa3d
@ -215,7 +215,7 @@ bool Downtime::HasValidConfigOwner() const
|
|||||||
}
|
}
|
||||||
|
|
||||||
String configOwner = GetConfigOwner();
|
String configOwner = GetConfigOwner();
|
||||||
return configOwner.IsEmpty() || GetObject<ScheduledDowntime>(configOwner);
|
return configOwner.IsEmpty() || Zone::GetByName(GetAuthoritativeZone()) != Zone::GetLocalZone() || GetObject<ScheduledDowntime>(configOwner);
|
||||||
}
|
}
|
||||||
|
|
||||||
int Downtime::GetNextDowntimeID()
|
int Downtime::GetNextDowntimeID()
|
||||||
@ -251,6 +251,10 @@ String Downtime::AddDowntime(const Checkable::Ptr& checkable, const String& auth
|
|||||||
attrs->Set("config_owner", scheduledDowntime);
|
attrs->Set("config_owner", scheduledDowntime);
|
||||||
attrs->Set("entry_time", Utility::GetTime());
|
attrs->Set("entry_time", Utility::GetTime());
|
||||||
|
|
||||||
|
if (!scheduledDowntime.IsEmpty()) {
|
||||||
|
attrs->Set("authoritative_zone", Zone::GetLocalZone()->GetName());
|
||||||
|
}
|
||||||
|
|
||||||
Host::Ptr host;
|
Host::Ptr host;
|
||||||
Service::Ptr service;
|
Service::Ptr service;
|
||||||
tie(host, service) = GetHostService(checkable);
|
tie(host, service) = GetHostService(checkable);
|
||||||
|
@ -84,6 +84,7 @@ class Downtime : ConfigObject < DowntimeNameComposer
|
|||||||
[state] int legacy_id;
|
[state] int legacy_id;
|
||||||
[state] bool was_cancelled;
|
[state] bool was_cancelled;
|
||||||
[config] String config_owner;
|
[config] String config_owner;
|
||||||
|
[config] String authoritative_zone;
|
||||||
};
|
};
|
||||||
|
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user