]> granicus.if.org Git - icinga2/commitdiff
Fix incorrect error messages for apply-for
authorGunnar Beutner <gunnar@beutner.name>
Thu, 24 Sep 2015 06:29:13 +0000 (08:29 +0200)
committerMichael Friedrich <michael.friedrich@netways.de>
Fri, 25 Sep 2015 12:38:40 +0000 (14:38 +0200)
fixes #10205

lib/icinga/dependency-apply.cpp
lib/icinga/notification-apply.cpp
lib/icinga/scheduleddowntime-apply.cpp
lib/icinga/service-apply.cpp

index 14d2b84bfdf102728116e71e2a8faff7c7654322..190f972dbeca0ff9e82b4c55edfa6d178f9bc1ff 100644 (file)
@@ -117,7 +117,7 @@ bool Dependency::EvaluateApplyRule(const Checkable::Ptr& checkable, const ApplyR
 
        if (vinstances.IsObjectType<Array>()) {
                if (!rule.GetFVVar().IsEmpty())
-                       BOOST_THROW_EXCEPTION(ScriptError("Array iterator requires value to be an array.", di));
+                       BOOST_THROW_EXCEPTION(ScriptError("Dictionary iterator requires value to be a dictionary.", di));
 
                Array::Ptr arr = vinstances;
                Array::Ptr arrclone = arr->ShallowClone();
@@ -136,7 +136,7 @@ bool Dependency::EvaluateApplyRule(const Checkable::Ptr& checkable, const ApplyR
                }
        } else if (vinstances.IsObjectType<Dictionary>()) {
                if (rule.GetFVVar().IsEmpty())
-                       BOOST_THROW_EXCEPTION(ScriptError("Dictionary iterator requires value to be a dictionary.", di));
+                       BOOST_THROW_EXCEPTION(ScriptError("Array iterator requires value to be an array.", di));
        
                Dictionary::Ptr dict = vinstances;
 
index fd8e5a3b354a8571c1b6536b9024a2ab9e6b5ed6..f00500188b640f5a24a91f40c952d25e4a7ab772 100644 (file)
@@ -116,7 +116,7 @@ bool Notification::EvaluateApplyRule(const Checkable::Ptr& checkable, const Appl
 
        if (vinstances.IsObjectType<Array>()) {
                if (!rule.GetFVVar().IsEmpty())
-                       BOOST_THROW_EXCEPTION(ScriptError("Array iterator requires value to be an array.", di));
+                       BOOST_THROW_EXCEPTION(ScriptError("Dictionary iterator requires value to be a dictionary.", di));
 
                Array::Ptr arr = vinstances;
 
@@ -134,7 +134,7 @@ bool Notification::EvaluateApplyRule(const Checkable::Ptr& checkable, const Appl
                }
        } else if (vinstances.IsObjectType<Dictionary>()) {
                if (rule.GetFVVar().IsEmpty())
-                       BOOST_THROW_EXCEPTION(ScriptError("Dictionary iterator requires value to be a dictionary.", di));
+                       BOOST_THROW_EXCEPTION(ScriptError("Array iterator requires value to be an array.", di));
        
                Dictionary::Ptr dict = vinstances;
 
index af581230465b7c76adab12cfa7ebc8bb30a87386..bbdf7a66e6128de75d1e76b7ce7842e1c8abf372 100644 (file)
@@ -115,7 +115,7 @@ bool ScheduledDowntime::EvaluateApplyRule(const Checkable::Ptr& checkable, const
 
        if (vinstances.IsObjectType<Array>()) {
                if (!rule.GetFVVar().IsEmpty())
-                       BOOST_THROW_EXCEPTION(ScriptError("Array iterator requires value to be an array.", di));
+                       BOOST_THROW_EXCEPTION(ScriptError("Dictionary iterator requires value to be a dictionary.", di));
 
                Array::Ptr arr = vinstances;
                Array::Ptr arrclone = arr->ShallowClone();
@@ -134,7 +134,7 @@ bool ScheduledDowntime::EvaluateApplyRule(const Checkable::Ptr& checkable, const
                }
        } else if (vinstances.IsObjectType<Dictionary>()) {
                if (rule.GetFVVar().IsEmpty())
-                       BOOST_THROW_EXCEPTION(ScriptError("Dictionary iterator requires value to be a dictionary.", di));
+                       BOOST_THROW_EXCEPTION(ScriptError("Array iterator requires value to be an array.", di));
        
                Dictionary::Ptr dict = vinstances;
 
index 6af43204b0d36eae363d4156a5ab53f2324dd450..9e6bc6c6ae20f2e63b64beec61549f3dee9192b1 100644 (file)
@@ -103,7 +103,7 @@ bool Service::EvaluateApplyRule(const Host::Ptr& host, const ApplyRule& rule)
 
        if (vinstances.IsObjectType<Array>()) {
                if (!rule.GetFVVar().IsEmpty())
-                       BOOST_THROW_EXCEPTION(ScriptError("Array iterator requires value to be an array.", di));
+                       BOOST_THROW_EXCEPTION(ScriptError("Dictionary iterator requires value to be a dictionary.", di));
 
                Array::Ptr arr = vinstances;
                Array::Ptr arrclone = arr->ShallowClone();
@@ -122,7 +122,7 @@ bool Service::EvaluateApplyRule(const Host::Ptr& host, const ApplyRule& rule)
                }
        } else if (vinstances.IsObjectType<Dictionary>()) {
                if (rule.GetFVVar().IsEmpty())
-                       BOOST_THROW_EXCEPTION(ScriptError("Dictionary iterator requires value to be a dictionary.", di));
+                       BOOST_THROW_EXCEPTION(ScriptError("Array iterator requires value to be an array.", di));
        
                Dictionary::Ptr dict = vinstances;