[icinga-checkins] icinga.org: icinga2/master: Fixed error message for the method validator.

git at icinga.org git at icinga.org
Wed Feb 6 13:25:27 CET 2013


Module: icinga2
Branch: master
Commit: 07e85650451dc549b2dc013b8a3248a456a9c646
URL:    https://git.icinga.org/?p=icinga2.git;a=commit;h=07e85650451dc549b2dc013b8a3248a456a9c646

Author: Gunnar Beutner <gunnar.beutner at netways.de>
Date:   Wed Feb  6 13:25:04 2013 +0100

Fixed error message for the method validator.

---

 lib/config/configtype.cpp |   12 +++++++++---
 1 files changed, 9 insertions(+), 3 deletions(-)

diff --git a/lib/config/configtype.cpp b/lib/config/configtype.cpp
index 0c4dfad..1d9a563 100644
--- a/lib/config/configtype.cpp
+++ b/lib/config/configtype.cpp
@@ -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.");
 		}
 	}
 





More information about the icinga-checkins mailing list