Clean up some parts of the code

This commit is contained in:
Gunnar Beutner 2014-08-17 17:57:20 +02:00
parent c4d448efe5
commit 65bec9e904
56 changed files with 324 additions and 325 deletions

View File

@ -419,8 +419,7 @@ void DbConnection::ValidateFailoverTimeout(const String& location, const Diction
if (!attrs->Contains("failover_timeout")) if (!attrs->Contains("failover_timeout"))
return; return;
Value failover_timeout = attrs->Get("failover_timeout"); if (attrs->Get("failover_timeout") < 60) {
if (failover_timeout < 60) {
ConfigCompilerContext::GetInstance()->AddMessage(true, "Validation failed for " + ConfigCompilerContext::GetInstance()->AddMessage(true, "Validation failed for " +
location + ": Failover timeout minimum is 60s."); location + ": Failover timeout minimum is 60s.");
} }

View File

@ -37,7 +37,7 @@ void HostGroup::RegisterObjectRuleHandler(void)
ObjectRule::RegisterType("HostGroup", &HostGroup::EvaluateObjectRules); ObjectRule::RegisterType("HostGroup", &HostGroup::EvaluateObjectRules);
} }
bool HostGroup::EvaluateObjectRuleOne(const Host::Ptr host, const ObjectRule& rule) bool HostGroup::EvaluateObjectRuleOne(const Host::Ptr& host, const ObjectRule& rule)
{ {
DebugInfo di = rule.GetDebugInfo(); DebugInfo di = rule.GetDebugInfo();

View File

@ -44,7 +44,7 @@ public:
void AddMember(const Host::Ptr& host); void AddMember(const Host::Ptr& host);
void RemoveMember(const Host::Ptr& host); void RemoveMember(const Host::Ptr& host);
bool ResolveGroupMembership(Host::Ptr const& host, bool add = true, int rstack = 0); bool ResolveGroupMembership(const Host::Ptr& host, bool add = true, int rstack = 0);
static void RegisterObjectRuleHandler(void); static void RegisterObjectRuleHandler(void);
@ -52,7 +52,7 @@ private:
mutable boost::mutex m_HostGroupMutex; mutable boost::mutex m_HostGroupMutex;
std::set<Host::Ptr> m_Members; std::set<Host::Ptr> m_Members;
static bool EvaluateObjectRuleOne(const Host::Ptr host, const ObjectRule& rule); static bool EvaluateObjectRuleOne(const Host::Ptr& host, const ObjectRule& rule);
static void EvaluateObjectRule(const ObjectRule& rule); static void EvaluateObjectRule(const ObjectRule& rule);
static void EvaluateObjectRules(const std::vector<ObjectRule>& rules); static void EvaluateObjectRules(const std::vector<ObjectRule>& rules);
}; };

View File

@ -37,7 +37,7 @@ void ServiceGroup::RegisterObjectRuleHandler(void)
ObjectRule::RegisterType("ServiceGroup", &ServiceGroup::EvaluateObjectRules); ObjectRule::RegisterType("ServiceGroup", &ServiceGroup::EvaluateObjectRules);
} }
bool ServiceGroup::EvaluateObjectRuleOne(const Service::Ptr service, const ObjectRule& rule) bool ServiceGroup::EvaluateObjectRuleOne(const Service::Ptr& service, const ObjectRule& rule)
{ {
DebugInfo di = rule.GetDebugInfo(); DebugInfo di = rule.GetDebugInfo();

View File

@ -44,7 +44,7 @@ public:
void AddMember(const Service::Ptr& service); void AddMember(const Service::Ptr& service);
void RemoveMember(const Service::Ptr& service); void RemoveMember(const Service::Ptr& service);
bool ResolveGroupMembership(Service::Ptr const& service, bool add = true, int rstack = 0); bool ResolveGroupMembership(const Service::Ptr& service, bool add = true, int rstack = 0);
static void RegisterObjectRuleHandler(void); static void RegisterObjectRuleHandler(void);
@ -52,7 +52,7 @@ private:
mutable boost::mutex m_ServiceGroupMutex; mutable boost::mutex m_ServiceGroupMutex;
std::set<Service::Ptr> m_Members; std::set<Service::Ptr> m_Members;
static bool EvaluateObjectRuleOne(const Service::Ptr service, const ObjectRule& rule); static bool EvaluateObjectRuleOne(const Service::Ptr& service, const ObjectRule& rule);
static void EvaluateObjectRule(const ObjectRule& rule); static void EvaluateObjectRule(const ObjectRule& rule);
static void EvaluateObjectRules(const std::vector<ObjectRule>& rules); static void EvaluateObjectRules(const std::vector<ObjectRule>& rules);
}; };

View File

@ -37,7 +37,7 @@ void UserGroup::RegisterObjectRuleHandler(void)
ObjectRule::RegisterType("UserGroup", &UserGroup::EvaluateObjectRules); ObjectRule::RegisterType("UserGroup", &UserGroup::EvaluateObjectRules);
} }
bool UserGroup::EvaluateObjectRuleOne(const User::Ptr user, const ObjectRule& rule) bool UserGroup::EvaluateObjectRuleOne(const User::Ptr& user, const ObjectRule& rule)
{ {
DebugInfo di = rule.GetDebugInfo(); DebugInfo di = rule.GetDebugInfo();

View File

@ -44,7 +44,7 @@ public:
void AddMember(const User::Ptr& user); void AddMember(const User::Ptr& user);
void RemoveMember(const User::Ptr& user); void RemoveMember(const User::Ptr& user);
bool ResolveGroupMembership(User::Ptr const& user, bool add = true, int rstack = 0); bool ResolveGroupMembership(const User::Ptr& user, bool add = true, int rstack = 0);
static void RegisterObjectRuleHandler(void); static void RegisterObjectRuleHandler(void);
@ -52,7 +52,7 @@ private:
mutable boost::mutex m_UserGroupMutex; mutable boost::mutex m_UserGroupMutex;
std::set<User::Ptr> m_Members; std::set<User::Ptr> m_Members;
static bool EvaluateObjectRuleOne(const User::Ptr user, const ObjectRule& rule); static bool EvaluateObjectRuleOne(const User::Ptr& user, const ObjectRule& rule);
static void EvaluateObjectRule(const ObjectRule& rule); static void EvaluateObjectRule(const ObjectRule& rule);
static void EvaluateObjectRules(const std::vector<ObjectRule>& rules); static void EvaluateObjectRules(const std::vector<ObjectRule>& rules);
}; };