mirror of https://github.com/Icinga/icinga2.git
Don't validate config items if we've already encountered an error.
This commit is contained in:
parent
4e7c43c8c8
commit
beeddb6840
|
@ -49,15 +49,26 @@ static bool LoadConfigFiles(bool validateOnly)
|
||||||
}
|
}
|
||||||
|
|
||||||
String name, fragment;
|
String name, fragment;
|
||||||
BOOST_FOREACH(tie(name, fragment), ConfigCompiler::GetConfigFragments()) {
|
BOOST_FOREACH(tie(name, fragment), ConfigFragmentRegistry::GetInstance()->GetItems()) {
|
||||||
ConfigCompiler::CompileText(name, fragment);
|
ConfigCompiler::CompileText(name, fragment);
|
||||||
}
|
}
|
||||||
|
|
||||||
ConfigCompilerContext::SetContext(NULL);
|
ConfigCompilerContext::SetContext(NULL);
|
||||||
|
|
||||||
|
bool hasError = false;
|
||||||
|
|
||||||
|
BOOST_FOREACH(const ConfigCompilerError& error, context.GetErrors()) {
|
||||||
|
if (!error.Warning) {
|
||||||
|
hasError = true;
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/* Don't validate if we have already encountered at least one error. */
|
||||||
|
if (!hasError)
|
||||||
context.Validate();
|
context.Validate();
|
||||||
|
|
||||||
bool hasError = false;
|
hasError = false;
|
||||||
|
|
||||||
BOOST_FOREACH(const ConfigCompilerError& error, context.GetErrors()) {
|
BOOST_FOREACH(const ConfigCompilerError& error, context.GetErrors()) {
|
||||||
if (error.Warning) {
|
if (error.Warning) {
|
||||||
|
|
Loading…
Reference in New Issue