mirror of https://github.com/Icinga/icinga2.git
Replace if( with if (
This commit is contained in:
parent
8ca57cba03
commit
cb6f1043e1
|
@ -347,7 +347,7 @@ int DaemonCommand::Run(const po::variables_map& vm, const std::vector<std::strin
|
|||
return EXIT_SUCCESS;
|
||||
}
|
||||
|
||||
if(vm.count("reload-internal")) {
|
||||
if (vm.count("reload-internal")) {
|
||||
int parentpid = vm["reload-internal"].as<int>();
|
||||
Log(LogInformation, "cli")
|
||||
<< "Terminating previous instance of Icinga (PID " << parentpid << ")";
|
||||
|
|
|
@ -151,7 +151,7 @@ wizard_endpoint_loop_start:
|
|||
std::getline(std::cin, answer);
|
||||
boost::algorithm::to_lower(answer);
|
||||
|
||||
if(answer.empty()) {
|
||||
if (answer.empty()) {
|
||||
Log(LogWarning, "cli", "Master CN is required! Please retry.");
|
||||
goto wizard_endpoint_loop_start;
|
||||
}
|
||||
|
|
|
@ -493,7 +493,7 @@ bool RepositoryUtility::SetObjectAttributeInternal(const String& name, const Str
|
|||
std::cout << "Writing object '" << name << "' to path '" << path << "'.\n";
|
||||
|
||||
//TODO: Create a patch file
|
||||
if(!WriteObjectToRepository(path, name, type, obj)) {
|
||||
if (!WriteObjectToRepository(path, name, type, obj)) {
|
||||
Log(LogCritical, "cli")
|
||||
<< "Can't write object " << name << " to repository.\n";
|
||||
return false;
|
||||
|
|
|
@ -81,7 +81,7 @@ void Command::ValidateArguments(const String& location, const Command::Ptr& obje
|
|||
|
||||
String argstr = argval;
|
||||
|
||||
if(!Utility::ValidateMacroString(argstr)) {
|
||||
if (!Utility::ValidateMacroString(argstr)) {
|
||||
BOOST_THROW_EXCEPTION(ScriptError("Validation failed for " +
|
||||
location + ": Closing $ not found in macro format string '" + argstr + "'.", object->GetDebugInfo()));
|
||||
}
|
||||
|
@ -102,7 +102,7 @@ void Command::ValidateEnvironmentVariables(const String& location, const Command
|
|||
if (!envval.IsString() || envval.IsEmpty())
|
||||
continue;
|
||||
|
||||
if(!Utility::ValidateMacroString(envval)) {
|
||||
if (!Utility::ValidateMacroString(envval)) {
|
||||
BOOST_THROW_EXCEPTION(ScriptError("Validation failed for " +
|
||||
location + ": Closing $ not found in macro format string '" + envval + "'.", object->GetDebugInfo()));
|
||||
}
|
||||
|
|
|
@ -85,10 +85,10 @@ void CustomVarObject::ValidateCustomAttributes(const String& location, const Cus
|
|||
|
||||
ObjectLock xlock(varval_dict);
|
||||
BOOST_FOREACH(const Dictionary::Pair& kv_var, varval_dict) {
|
||||
if(kv_var.second.IsEmpty())
|
||||
if (kv_var.second.IsEmpty())
|
||||
continue;
|
||||
|
||||
if(!Utility::ValidateMacroString(kv_var.second)) {
|
||||
if (!Utility::ValidateMacroString(kv_var.second)) {
|
||||
BOOST_THROW_EXCEPTION(ScriptError("Validation failed for " +
|
||||
location + ": Closing $ not found in macro format string '" + kv_var.second + "'.", object->GetDebugInfo()));
|
||||
}
|
||||
|
@ -102,7 +102,7 @@ void CustomVarObject::ValidateCustomAttributes(const String& location, const Cus
|
|||
if (arrval.IsEmpty())
|
||||
continue;
|
||||
|
||||
if(!Utility::ValidateMacroString(arrval)) {
|
||||
if (!Utility::ValidateMacroString(arrval)) {
|
||||
BOOST_THROW_EXCEPTION(ScriptError("Validation failed for " +
|
||||
location + ": Closing $ not found in macro format string '" + arrval + "'.", object->GetDebugInfo()));
|
||||
}
|
||||
|
@ -113,10 +113,10 @@ void CustomVarObject::ValidateCustomAttributes(const String& location, const Cus
|
|||
|
||||
String varstr = varval;
|
||||
|
||||
if(!Utility::ValidateMacroString(varstr)) {
|
||||
if (!Utility::ValidateMacroString(varstr)) {
|
||||
BOOST_THROW_EXCEPTION(ScriptError("Validation failed for " +
|
||||
location + ": Closing $ not found in macro format string '" + varstr + "'.", object->GetDebugInfo()));
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -58,7 +58,7 @@ Value ContactGroupsTable::NameAccessor(const Value& row)
|
|||
{
|
||||
UserGroup::Ptr user_group = static_cast<UserGroup::Ptr>(row);
|
||||
|
||||
if(!user_group)
|
||||
if (!user_group)
|
||||
return Empty;
|
||||
|
||||
return user_group->GetName();
|
||||
|
@ -68,7 +68,7 @@ Value ContactGroupsTable::AliasAccessor(const Value& row)
|
|||
{
|
||||
UserGroup::Ptr user_group = static_cast<UserGroup::Ptr>(row);
|
||||
|
||||
if(!user_group)
|
||||
if (!user_group)
|
||||
return Empty;
|
||||
|
||||
return user_group->GetName();
|
||||
|
@ -78,7 +78,7 @@ Value ContactGroupsTable::MembersAccessor(const Value& row)
|
|||
{
|
||||
UserGroup::Ptr user_group = static_cast<UserGroup::Ptr>(row);
|
||||
|
||||
if(!user_group)
|
||||
if (!user_group)
|
||||
return Empty;
|
||||
|
||||
Array::Ptr members = new Array();
|
||||
|
|
|
@ -234,10 +234,11 @@ Value GraphiteWriter::EscapeMacroMetric(const Value& value)
|
|||
|
||||
void GraphiteWriter::ValidateNameTemplates(const String& location, const GraphiteWriter::Ptr& object)
|
||||
{
|
||||
if(!Utility::ValidateMacroString(object->GetHostNameTemplate())) {
|
||||
if (!Utility::ValidateMacroString(object->GetHostNameTemplate())) {
|
||||
BOOST_THROW_EXCEPTION(ScriptError("Validation failed for " +
|
||||
location + ": Closing $ not found in macro format string '" + object->GetHostNameTemplate() + "'.", object->GetDebugInfo()));
|
||||
}
|
||||
|
||||
if (!Utility::ValidateMacroString(object->GetServiceNameTemplate())) {
|
||||
BOOST_THROW_EXCEPTION(ScriptError("Validation failed for " +
|
||||
location + ": Closing $ not found in macro format string '" + object->GetServiceNameTemplate() + "'.", object->GetDebugInfo()));
|
||||
|
|
|
@ -142,12 +142,13 @@ void PerfdataWriter::RotationTimerHandler(void)
|
|||
|
||||
void PerfdataWriter::ValidateFormatTemplates(const String& location, const PerfdataWriter::Ptr& object)
|
||||
{
|
||||
if(!Utility::ValidateMacroString(object->GetHostFormatTemplate())) {
|
||||
if (!Utility::ValidateMacroString(object->GetHostFormatTemplate())) {
|
||||
BOOST_THROW_EXCEPTION(ScriptError("Validation failed for " +
|
||||
location + ": Closing $ not found in macro format string '" + object->GetHostFormatTemplate() + "'.", object->GetDebugInfo()));
|
||||
}
|
||||
|
||||
if (!Utility::ValidateMacroString(object->GetServiceFormatTemplate())) {
|
||||
BOOST_THROW_EXCEPTION(ScriptError("Validation failed for " +
|
||||
location + ": Closing $ not found in macro format string '" + object->GetHostFormatTemplate() + "'.", object->GetDebugInfo()));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue