MCPcopy Create free account
hub / github.com/Icinga/icinga2 / OnAllConfigLoaded

Method OnAllConfigLoaded

lib/icinga/host.cpp:20–49  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

18REGISTER_TYPE(Host);
19
20void Host::OnAllConfigLoaded()
21{
22 ObjectImpl<Host>::OnAllConfigLoaded();
23
24 String zoneName = GetZoneName();
25
26 if (!zoneName.IsEmpty()) {
27 Zone::Ptr zone = Zone::GetByName(zoneName);
28
29 if (zone && zone->IsGlobal())
30 BOOST_THROW_EXCEPTION(std::invalid_argument("Host '" + GetName() + "' cannot be put into global zone '" + zone->GetName() + "'."));
31 }
32
33 HostGroup::EvaluateObjectRules(this);
34
35 Array::Ptr groups = GetGroups();
36
37 if (groups) {
38 groups = groups->ShallowClone();
39
40 ObjectLock olock(groups);
41
42 for (String name : groups) {
43 HostGroup::Ptr hg = HostGroup::GetByName(name);
44
45 if (hg)
46 hg->ResolveGroupMembership(this, true);
47 }
48 }
49}
50
51void Host::CreateChildObjects(const Type::Ptr& childType)
52{

Callers

nothing calls this directly

Calls 5

IsGlobalMethod · 0.80
IsEmptyMethod · 0.45
GetNameMethod · 0.45
ShallowCloneMethod · 0.45

Tested by

no test coverage detected