This commit is contained in:
Alexander Aleksandrovič Klimov 2026-02-03 15:23:52 +01:00 committed by GitHub
commit 40c4df8cab
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
10 changed files with 21 additions and 4 deletions

View file

@ -32,7 +32,9 @@ public:
class Comment : ConfigObject < CommentNameComposer
{
load_after Host;
load_after HostGroup;
load_after Service;
load_after ServiceGroup;
[config, no_user_modify, protected, required, navigation(host)] name(Host) host_name {
navigate {{{

View file

@ -23,7 +23,9 @@ class Dependency : CustomVarObject < DependencyNameComposer
activation_priority -10;
load_after Host;
load_after HostGroup;
load_after Service;
load_after ServiceGroup;
[config, no_user_modify, required, navigation(child_host)] name(Host) child_host_name {
navigate {{{

View file

@ -23,7 +23,9 @@ class Downtime : ConfigObject < DowntimeNameComposer
activation_priority -10;
load_after Host;
load_after HostGroup;
load_after Service;
load_after ServiceGroup;
[config, no_user_modify, required, navigation(host)] name(Host) host_name {
navigate {{{

View file

@ -29,8 +29,6 @@ void Host::OnAllConfigLoaded()
BOOST_THROW_EXCEPTION(std::invalid_argument("Host '" + GetName() + "' cannot be put into global zone '" + zone->GetName() + "'."));
}
HostGroup::EvaluateObjectRules(this);
Array::Ptr groups = GetGroups();
if (groups) {
@ -49,6 +47,9 @@ void Host::OnAllConfigLoaded()
void Host::CreateChildObjects(const Type::Ptr& childType)
{
if (childType == HostGroup::TypeInstance)
HostGroup::EvaluateObjectRules(this);
if (childType == ScheduledDowntime::TypeInstance)
ScheduledDowntime::EvaluateApplyRules(this);

View file

@ -9,6 +9,8 @@ namespace icinga
class HostGroup : CustomVarObject
{
load_after Host;
[config] String display_name {
get {{{
String displayName = m_DisplayName.load();

View file

@ -21,7 +21,9 @@ public:
class Notification : CustomVarObject < NotificationNameComposer
{
load_after Host;
load_after HostGroup;
load_after Service;
load_after ServiceGroup;
load_after User;
load_after UserGroup;

View file

@ -24,7 +24,9 @@ class ScheduledDowntime : CustomVarObject < ScheduledDowntimeNameComposer
activation_priority 20;
load_after Host;
load_after HostGroup;
load_after Service;
load_after ServiceGroup;
[config, protected, no_user_modify, required, navigation(host)] name(Host) host_name {
navigate {{{

View file

@ -56,8 +56,6 @@ void Service::OnAllConfigLoaded()
if (m_Host)
m_Host->AddService(this);
ServiceGroup::EvaluateObjectRules(this);
Array::Ptr groups = GetGroups();
if (groups) {
@ -76,6 +74,9 @@ void Service::OnAllConfigLoaded()
void Service::CreateChildObjects(const Type::Ptr& childType)
{
if (childType == ServiceGroup::TypeInstance)
ServiceGroup::EvaluateObjectRules(this);
if (childType == ScheduledDowntime::TypeInstance)
ScheduledDowntime::EvaluateApplyRules(this);

View file

@ -25,6 +25,7 @@ class Service : Checkable < ServiceNameComposer
load_after ApiListener;
load_after Endpoint;
load_after Host;
load_after HostGroup;
load_after Zone;
[config, no_user_modify, required, signal_with_old_value] array(name(ServiceGroup)) groups {

View file

@ -9,6 +9,8 @@ namespace icinga
class ServiceGroup : CustomVarObject
{
load_after Service;
[config] String display_name {
get {{{
String displayName = m_DisplayName.load();