]> granicus.if.org Git - icinga2/commitdiff
Fixed error message for the method validator.
authorGunnar Beutner <gunnar.beutner@netways.de>
Wed, 6 Feb 2013 12:25:04 +0000 (13:25 +0100)
committerGunnar Beutner <gunnar.beutner@netways.de>
Wed, 6 Feb 2013 12:25:04 +0000 (13:25 +0100)
lib/config/configtype.cpp

index 0c4dfadc49fa5749d6fdb0955544f8764795b459..1d9a563102f4822da134a5c5ee4bd2e257c07239 100644 (file)
@@ -184,10 +184,16 @@ void ConfigType::ValidateMethods(const ScriptTask::Ptr& task,
        Dictionary::Ptr attrs = arguments[1];
 
        String key;
-       BOOST_FOREACH(tie(key, tuples::ignore), attrs) {
-               if (!ScriptFunction::GetByName(key)) {
+       Value value;
+       BOOST_FOREACH(tie(key, value), attrs) {
+               if (!value.IsScalar())
+                       continue;
+
+               String method = value;
+
+               if (!ScriptFunction::GetByName(method)) {
                        ConfigCompilerContext::GetContext()->AddError(false, "Validation failed for " +
-                           location + ": Method '" + key + "' not found.");
+                           location + ": Script function '" + method + "' not found.");
                }
        }