Fix incorrect error messages for apply-for

fixes #10205
This commit is contained in:
Gunnar Beutner 2015-09-24 08:29:13 +02:00 committed by Michael Friedrich
parent c3a47443af
commit 992e045355
4 changed files with 8 additions and 8 deletions

View File

@ -117,7 +117,7 @@ bool Dependency::EvaluateApplyRule(const Checkable::Ptr& checkable, const ApplyR
if (vinstances.IsObjectType<Array>()) { if (vinstances.IsObjectType<Array>()) {
if (!rule.GetFVVar().IsEmpty()) 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 arr = vinstances;
Array::Ptr arrclone = arr->ShallowClone(); Array::Ptr arrclone = arr->ShallowClone();
@ -136,7 +136,7 @@ bool Dependency::EvaluateApplyRule(const Checkable::Ptr& checkable, const ApplyR
} }
} else if (vinstances.IsObjectType<Dictionary>()) { } else if (vinstances.IsObjectType<Dictionary>()) {
if (rule.GetFVVar().IsEmpty()) 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; Dictionary::Ptr dict = vinstances;

View File

@ -116,7 +116,7 @@ bool Notification::EvaluateApplyRule(const Checkable::Ptr& checkable, const Appl
if (vinstances.IsObjectType<Array>()) { if (vinstances.IsObjectType<Array>()) {
if (!rule.GetFVVar().IsEmpty()) 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 arr = vinstances;
@ -134,7 +134,7 @@ bool Notification::EvaluateApplyRule(const Checkable::Ptr& checkable, const Appl
} }
} else if (vinstances.IsObjectType<Dictionary>()) { } else if (vinstances.IsObjectType<Dictionary>()) {
if (rule.GetFVVar().IsEmpty()) 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; Dictionary::Ptr dict = vinstances;

View File

@ -115,7 +115,7 @@ bool ScheduledDowntime::EvaluateApplyRule(const Checkable::Ptr& checkable, const
if (vinstances.IsObjectType<Array>()) { if (vinstances.IsObjectType<Array>()) {
if (!rule.GetFVVar().IsEmpty()) 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 arr = vinstances;
Array::Ptr arrclone = arr->ShallowClone(); Array::Ptr arrclone = arr->ShallowClone();
@ -134,7 +134,7 @@ bool ScheduledDowntime::EvaluateApplyRule(const Checkable::Ptr& checkable, const
} }
} else if (vinstances.IsObjectType<Dictionary>()) { } else if (vinstances.IsObjectType<Dictionary>()) {
if (rule.GetFVVar().IsEmpty()) 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; Dictionary::Ptr dict = vinstances;

View File

@ -103,7 +103,7 @@ bool Service::EvaluateApplyRule(const Host::Ptr& host, const ApplyRule& rule)
if (vinstances.IsObjectType<Array>()) { if (vinstances.IsObjectType<Array>()) {
if (!rule.GetFVVar().IsEmpty()) 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 arr = vinstances;
Array::Ptr arrclone = arr->ShallowClone(); Array::Ptr arrclone = arr->ShallowClone();
@ -122,7 +122,7 @@ bool Service::EvaluateApplyRule(const Host::Ptr& host, const ApplyRule& rule)
} }
} else if (vinstances.IsObjectType<Dictionary>()) { } else if (vinstances.IsObjectType<Dictionary>()) {
if (rule.GetFVVar().IsEmpty()) 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; Dictionary::Ptr dict = vinstances;