mirror of
https://github.com/Icinga/icinga2.git
synced 2025-09-24 10:17:59 +02:00
parent_affecting_logging: a config object affects everything functionally depending on it
This commit is contained in:
parent
8c3b6adaec
commit
f98b5c5d7c
@ -34,12 +34,12 @@ class Comment : ConfigObject < CommentNameComposer
|
||||
load_after Host;
|
||||
load_after Service;
|
||||
|
||||
[config, no_user_modify, protected, required, navigation(host)] name(Host) host_name {
|
||||
[config, no_user_modify, protected, required, navigation(host), parent_affecting_logging] name(Host) host_name {
|
||||
navigate {{{
|
||||
return Host::GetByName(GetHostName());
|
||||
}}}
|
||||
};
|
||||
[config, no_user_modify, protected, navigation(service)] String service_name {
|
||||
[config, no_user_modify, protected, navigation(service), parent_affecting_logging] String service_name {
|
||||
track {{{
|
||||
if (!oldValue.IsEmpty()) {
|
||||
Service::Ptr service = Service::GetByNamePair(GetHostName(), oldValue);
|
||||
|
@ -50,13 +50,13 @@ class Dependency : CustomVarObject < DependencyNameComposer
|
||||
}}}
|
||||
};
|
||||
|
||||
[config, no_user_modify, required, navigation(parent_host)] name(Host) parent_host_name {
|
||||
[config, no_user_modify, required, navigation(parent_host), parent_affecting_logging] name(Host) parent_host_name {
|
||||
navigate {{{
|
||||
return Host::GetByName(GetParentHostName());
|
||||
}}}
|
||||
};
|
||||
|
||||
[config, no_user_modify, navigation(parent_service)] String parent_service_name {
|
||||
[config, no_user_modify, navigation(parent_service), parent_affecting_logging] String parent_service_name {
|
||||
track {{{
|
||||
if (!oldValue.IsEmpty()) {
|
||||
Service::Ptr service = Service::GetByNamePair(GetParentHostName(), oldValue);
|
||||
|
@ -167,6 +167,17 @@ void Downtime::Stop(bool runtimeRemoved)
|
||||
ObjectImpl<Downtime>::Stop(runtimeRemoved);
|
||||
}
|
||||
|
||||
void Downtime::GetParentsAffectingLogging(std::vector<ConfigObject::Ptr>& output) const
|
||||
{
|
||||
ObjectImpl<Downtime>::GetParentsAffectingLogging(output);
|
||||
|
||||
auto object (ConfigObject::GetObject<ScheduledDowntime>(GetConfigOwner()));
|
||||
|
||||
if (object) {
|
||||
output.emplace_back(std::move(object));
|
||||
}
|
||||
}
|
||||
|
||||
void Downtime::Pause()
|
||||
{
|
||||
if (m_CleanupTimer) {
|
||||
|
@ -78,6 +78,7 @@ public:
|
||||
protected:
|
||||
void Start(bool runtimeCreated) override;
|
||||
void Stop(bool runtimeRemoved) override;
|
||||
void GetParentsAffectingLogging(std::vector<ConfigObject::Ptr>& output) const override;
|
||||
|
||||
void Pause() override;
|
||||
void Resume() override;
|
||||
|
@ -25,12 +25,12 @@ class Downtime : ConfigObject < DowntimeNameComposer
|
||||
load_after Host;
|
||||
load_after Service;
|
||||
|
||||
[config, no_user_modify, required, navigation(host)] name(Host) host_name {
|
||||
[config, no_user_modify, required, navigation(host), parent_affecting_logging] name(Host) host_name {
|
||||
navigate {{{
|
||||
return Host::GetByName(GetHostName());
|
||||
}}}
|
||||
};
|
||||
[config, no_user_modify, navigation(service)] String service_name {
|
||||
[config, no_user_modify, navigation(service), parent_affecting_logging] String service_name {
|
||||
track {{{
|
||||
if (!oldValue.IsEmpty()) {
|
||||
Service::Ptr service = Service::GetByNamePair(GetHostName(), oldValue);
|
||||
|
Loading…
x
Reference in New Issue
Block a user