mirror of
https://github.com/Icinga/icinga2.git
synced 2025-07-21 12:44:58 +02:00
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;
|
return EXIT_SUCCESS;
|
||||||
}
|
}
|
||||||
|
|
||||||
if(vm.count("reload-internal")) {
|
if (vm.count("reload-internal")) {
|
||||||
int parentpid = vm["reload-internal"].as<int>();
|
int parentpid = vm["reload-internal"].as<int>();
|
||||||
Log(LogInformation, "cli")
|
Log(LogInformation, "cli")
|
||||||
<< "Terminating previous instance of Icinga (PID " << parentpid << ")";
|
<< "Terminating previous instance of Icinga (PID " << parentpid << ")";
|
||||||
|
@ -151,7 +151,7 @@ wizard_endpoint_loop_start:
|
|||||||
std::getline(std::cin, answer);
|
std::getline(std::cin, answer);
|
||||||
boost::algorithm::to_lower(answer);
|
boost::algorithm::to_lower(answer);
|
||||||
|
|
||||||
if(answer.empty()) {
|
if (answer.empty()) {
|
||||||
Log(LogWarning, "cli", "Master CN is required! Please retry.");
|
Log(LogWarning, "cli", "Master CN is required! Please retry.");
|
||||||
goto wizard_endpoint_loop_start;
|
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";
|
std::cout << "Writing object '" << name << "' to path '" << path << "'.\n";
|
||||||
|
|
||||||
//TODO: Create a patch file
|
//TODO: Create a patch file
|
||||||
if(!WriteObjectToRepository(path, name, type, obj)) {
|
if (!WriteObjectToRepository(path, name, type, obj)) {
|
||||||
Log(LogCritical, "cli")
|
Log(LogCritical, "cli")
|
||||||
<< "Can't write object " << name << " to repository.\n";
|
<< "Can't write object " << name << " to repository.\n";
|
||||||
return false;
|
return false;
|
||||||
|
@ -81,7 +81,7 @@ void Command::ValidateArguments(const String& location, const Command::Ptr& obje
|
|||||||
|
|
||||||
String argstr = argval;
|
String argstr = argval;
|
||||||
|
|
||||||
if(!Utility::ValidateMacroString(argstr)) {
|
if (!Utility::ValidateMacroString(argstr)) {
|
||||||
BOOST_THROW_EXCEPTION(ScriptError("Validation failed for " +
|
BOOST_THROW_EXCEPTION(ScriptError("Validation failed for " +
|
||||||
location + ": Closing $ not found in macro format string '" + argstr + "'.", object->GetDebugInfo()));
|
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())
|
if (!envval.IsString() || envval.IsEmpty())
|
||||||
continue;
|
continue;
|
||||||
|
|
||||||
if(!Utility::ValidateMacroString(envval)) {
|
if (!Utility::ValidateMacroString(envval)) {
|
||||||
BOOST_THROW_EXCEPTION(ScriptError("Validation failed for " +
|
BOOST_THROW_EXCEPTION(ScriptError("Validation failed for " +
|
||||||
location + ": Closing $ not found in macro format string '" + envval + "'.", object->GetDebugInfo()));
|
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);
|
ObjectLock xlock(varval_dict);
|
||||||
BOOST_FOREACH(const Dictionary::Pair& kv_var, varval_dict) {
|
BOOST_FOREACH(const Dictionary::Pair& kv_var, varval_dict) {
|
||||||
if(kv_var.second.IsEmpty())
|
if (kv_var.second.IsEmpty())
|
||||||
continue;
|
continue;
|
||||||
|
|
||||||
if(!Utility::ValidateMacroString(kv_var.second)) {
|
if (!Utility::ValidateMacroString(kv_var.second)) {
|
||||||
BOOST_THROW_EXCEPTION(ScriptError("Validation failed for " +
|
BOOST_THROW_EXCEPTION(ScriptError("Validation failed for " +
|
||||||
location + ": Closing $ not found in macro format string '" + kv_var.second + "'.", object->GetDebugInfo()));
|
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())
|
if (arrval.IsEmpty())
|
||||||
continue;
|
continue;
|
||||||
|
|
||||||
if(!Utility::ValidateMacroString(arrval)) {
|
if (!Utility::ValidateMacroString(arrval)) {
|
||||||
BOOST_THROW_EXCEPTION(ScriptError("Validation failed for " +
|
BOOST_THROW_EXCEPTION(ScriptError("Validation failed for " +
|
||||||
location + ": Closing $ not found in macro format string '" + arrval + "'.", object->GetDebugInfo()));
|
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;
|
String varstr = varval;
|
||||||
|
|
||||||
if(!Utility::ValidateMacroString(varstr)) {
|
if (!Utility::ValidateMacroString(varstr)) {
|
||||||
BOOST_THROW_EXCEPTION(ScriptError("Validation failed for " +
|
BOOST_THROW_EXCEPTION(ScriptError("Validation failed for " +
|
||||||
location + ": Closing $ not found in macro format string '" + varstr + "'.", object->GetDebugInfo()));
|
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);
|
UserGroup::Ptr user_group = static_cast<UserGroup::Ptr>(row);
|
||||||
|
|
||||||
if(!user_group)
|
if (!user_group)
|
||||||
return Empty;
|
return Empty;
|
||||||
|
|
||||||
return user_group->GetName();
|
return user_group->GetName();
|
||||||
@ -68,7 +68,7 @@ Value ContactGroupsTable::AliasAccessor(const Value& row)
|
|||||||
{
|
{
|
||||||
UserGroup::Ptr user_group = static_cast<UserGroup::Ptr>(row);
|
UserGroup::Ptr user_group = static_cast<UserGroup::Ptr>(row);
|
||||||
|
|
||||||
if(!user_group)
|
if (!user_group)
|
||||||
return Empty;
|
return Empty;
|
||||||
|
|
||||||
return user_group->GetName();
|
return user_group->GetName();
|
||||||
@ -78,7 +78,7 @@ Value ContactGroupsTable::MembersAccessor(const Value& row)
|
|||||||
{
|
{
|
||||||
UserGroup::Ptr user_group = static_cast<UserGroup::Ptr>(row);
|
UserGroup::Ptr user_group = static_cast<UserGroup::Ptr>(row);
|
||||||
|
|
||||||
if(!user_group)
|
if (!user_group)
|
||||||
return Empty;
|
return Empty;
|
||||||
|
|
||||||
Array::Ptr members = new Array();
|
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)
|
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 " +
|
BOOST_THROW_EXCEPTION(ScriptError("Validation failed for " +
|
||||||
location + ": Closing $ not found in macro format string '" + object->GetHostNameTemplate() + "'.", object->GetDebugInfo()));
|
location + ": Closing $ not found in macro format string '" + object->GetHostNameTemplate() + "'.", object->GetDebugInfo()));
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!Utility::ValidateMacroString(object->GetServiceNameTemplate())) {
|
if (!Utility::ValidateMacroString(object->GetServiceNameTemplate())) {
|
||||||
BOOST_THROW_EXCEPTION(ScriptError("Validation failed for " +
|
BOOST_THROW_EXCEPTION(ScriptError("Validation failed for " +
|
||||||
location + ": Closing $ not found in macro format string '" + object->GetServiceNameTemplate() + "'.", object->GetDebugInfo()));
|
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)
|
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 " +
|
BOOST_THROW_EXCEPTION(ScriptError("Validation failed for " +
|
||||||
location + ": Closing $ not found in macro format string '" + object->GetHostFormatTemplate() + "'.", object->GetDebugInfo()));
|
location + ": Closing $ not found in macro format string '" + object->GetHostFormatTemplate() + "'.", object->GetDebugInfo()));
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!Utility::ValidateMacroString(object->GetServiceFormatTemplate())) {
|
if (!Utility::ValidateMacroString(object->GetServiceFormatTemplate())) {
|
||||||
BOOST_THROW_EXCEPTION(ScriptError("Validation failed for " +
|
BOOST_THROW_EXCEPTION(ScriptError("Validation failed for " +
|
||||||
location + ": Closing $ not found in macro format string '" + object->GetHostFormatTemplate() + "'.", object->GetDebugInfo()));
|
location + ": Closing $ not found in macro format string '" + object->GetHostFormatTemplate() + "'.", object->GetDebugInfo()));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user