This commit is contained in:
Alexander Aleksandrovič Klimov 2026-04-07 08:11:43 +00:00 committed by GitHub
commit 00c3cb5689
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
10 changed files with 21 additions and 4 deletions

View file

@ -33,7 +33,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

@ -24,7 +24,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

@ -24,7 +24,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

@ -30,8 +30,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) {
@ -50,6 +48,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

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

View file

@ -22,7 +22,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

@ -25,7 +25,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

@ -57,8 +57,6 @@ void Service::OnAllConfigLoaded()
if (m_Host)
m_Host->AddService(this);
ServiceGroup::EvaluateObjectRules(this);
Array::Ptr groups = GetGroups();
if (groups) {
@ -77,6 +75,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

@ -26,6 +26,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

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