Fix state_filter attribute validation for Depdency objects.

Fixes #6110
This commit is contained in:
Michael Friedrich 2014-05-02 19:37:55 +02:00
parent c883b49480
commit 07c0c9e234
2 changed files with 6 additions and 3 deletions

View File

@ -23,6 +23,7 @@
#include "base/dynamictype.h"
#include "base/objectlock.h"
#include "base/logger_fwd.h"
#include "base/convert.h"
#include "base/scriptfunction.h"
#include <boost/foreach.hpp>
@ -184,11 +185,11 @@ void Dependency::ValidateFilters(const String& location, const Dictionary::Ptr&
if (!attrs->Contains("parent_service_name") && (sfilter & ~(StateFilterUp | StateFilterDown)) != 0) {
ConfigCompilerContext::GetInstance()->AddMessage(true, "Validation failed for " +
location + ": State filter is invalid.");
location + ": State filter is invalid for host dependency.");
}
if (attrs->Contains("parent_service_name") && (sfilter & ~(StateFilterOK | StateFilterWarning | StateFilterCritical | StateFilterUnknown)) != 0) {
ConfigCompilerContext::GetInstance()->AddMessage(true, "Validation failed for " +
location + ": State filter is invalid.");
location + ": State filter is invalid for service dependency.");
}
}

View File

@ -275,7 +275,9 @@
%attribute %name(TimePeriod) "period",
%attribute %number "state_filter",
%attribute %array "state_filter" {
%attribute %number "*"
},
%attribute %number "disable_checks",
%attribute %number "disable_notifications"
}