mirror of https://github.com/Icinga/icinga2.git
Fixed error message for the method validator.
This commit is contained in:
parent
07b50ecce8
commit
07e8565045
|
@ -184,10 +184,16 @@ void ConfigType::ValidateMethods(const ScriptTask::Ptr& task,
|
||||||
Dictionary::Ptr attrs = arguments[1];
|
Dictionary::Ptr attrs = arguments[1];
|
||||||
|
|
||||||
String key;
|
String key;
|
||||||
BOOST_FOREACH(tie(key, tuples::ignore), attrs) {
|
Value value;
|
||||||
if (!ScriptFunction::GetByName(key)) {
|
BOOST_FOREACH(tie(key, value), attrs) {
|
||||||
|
if (!value.IsScalar())
|
||||||
|
continue;
|
||||||
|
|
||||||
|
String method = value;
|
||||||
|
|
||||||
|
if (!ScriptFunction::GetByName(method)) {
|
||||||
ConfigCompilerContext::GetContext()->AddError(false, "Validation failed for " +
|
ConfigCompilerContext::GetContext()->AddError(false, "Validation failed for " +
|
||||||
location + ": Method '" + key + "' not found.");
|
location + ": Script function '" + method + "' not found.");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue