mirror of https://github.com/Icinga/icinga2.git
parent
c10da708ff
commit
4cb3d5b1f0
|
@ -41,6 +41,8 @@ void Host::OnConfigLoaded(void)
|
|||
Array::Ptr groups = GetGroups();
|
||||
|
||||
if (groups) {
|
||||
groups = groups->ShallowClone();
|
||||
|
||||
ObjectLock olock(groups);
|
||||
|
||||
BOOST_FOREACH(const String& name, groups) {
|
||||
|
|
|
@ -66,9 +66,6 @@ bool HostGroup::EvaluateObjectRuleOne(const Host::Ptr& host, const ObjectRule& r
|
|||
/* assign host group membership */
|
||||
group->ResolveGroupMembership(host, true);
|
||||
|
||||
/* update groups attribute for apply */
|
||||
host->AddGroup(group_name);
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
|
@ -100,6 +97,8 @@ std::set<Host::Ptr> HostGroup::GetMembers(void) const
|
|||
|
||||
void HostGroup::AddMember(const Host::Ptr& host)
|
||||
{
|
||||
host->AddGroup(GetName());
|
||||
|
||||
boost::mutex::scoped_lock lock(m_HostGroupMutex);
|
||||
m_Members.insert(host);
|
||||
}
|
||||
|
|
|
@ -42,6 +42,8 @@ void Service::OnConfigLoaded(void)
|
|||
Array::Ptr groups = GetGroups();
|
||||
|
||||
if (groups) {
|
||||
groups = groups->ShallowClone();
|
||||
|
||||
ObjectLock olock(groups);
|
||||
|
||||
BOOST_FOREACH(const String& name, groups) {
|
||||
|
|
|
@ -69,9 +69,6 @@ bool ServiceGroup::EvaluateObjectRuleOne(const Service::Ptr& service, const Obje
|
|||
/* assign service group membership */
|
||||
group->ResolveGroupMembership(service, true);
|
||||
|
||||
/* update groups attribute for apply */
|
||||
service->AddGroup(group_name);
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
|
@ -103,6 +100,8 @@ std::set<Service::Ptr> ServiceGroup::GetMembers(void) const
|
|||
|
||||
void ServiceGroup::AddMember(const Service::Ptr& service)
|
||||
{
|
||||
service->AddGroup(GetName());
|
||||
|
||||
boost::mutex::scoped_lock lock(m_ServiceGroupMutex);
|
||||
m_Members.insert(service);
|
||||
}
|
||||
|
|
|
@ -40,6 +40,8 @@ void User::OnConfigLoaded(void)
|
|||
Array::Ptr groups = GetGroups();
|
||||
|
||||
if (groups) {
|
||||
groups = groups->ShallowClone();
|
||||
|
||||
ObjectLock olock(groups);
|
||||
|
||||
BOOST_FOREACH(const String& name, groups) {
|
||||
|
|
|
@ -66,9 +66,6 @@ bool UserGroup::EvaluateObjectRuleOne(const User::Ptr& user, const ObjectRule& r
|
|||
/* assign user group membership */
|
||||
group->ResolveGroupMembership(user, true);
|
||||
|
||||
/* update groups attribute for apply */
|
||||
user->AddGroup(group_name);
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
|
@ -100,6 +97,8 @@ std::set<User::Ptr> UserGroup::GetMembers(void) const
|
|||
|
||||
void UserGroup::AddMember(const User::Ptr& user)
|
||||
{
|
||||
user->AddGroup(GetName());
|
||||
|
||||
boost::mutex::scoped_lock lock(m_UserGroupMutex);
|
||||
m_Members.insert(user);
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue