| 18 | REGISTER_TYPE(Host); |
| 19 | |
| 20 | void 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 | |
| 51 | void Host::CreateChildObjects(const Type::Ptr& childType) |
| 52 | { |
nothing calls this directly
no test coverage detected