mirror of
https://github.com/Icinga/icinga2.git
synced 2025-07-25 06:34:42 +02:00
Fix state_filter attribute validation for Depdency objects.
Fixes #6110
This commit is contained in:
parent
c883b49480
commit
07c0c9e234
@ -23,6 +23,7 @@
|
|||||||
#include "base/dynamictype.h"
|
#include "base/dynamictype.h"
|
||||||
#include "base/objectlock.h"
|
#include "base/objectlock.h"
|
||||||
#include "base/logger_fwd.h"
|
#include "base/logger_fwd.h"
|
||||||
|
#include "base/convert.h"
|
||||||
#include "base/scriptfunction.h"
|
#include "base/scriptfunction.h"
|
||||||
#include <boost/foreach.hpp>
|
#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) {
|
if (!attrs->Contains("parent_service_name") && (sfilter & ~(StateFilterUp | StateFilterDown)) != 0) {
|
||||||
ConfigCompilerContext::GetInstance()->AddMessage(true, "Validation failed for " +
|
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) {
|
if (attrs->Contains("parent_service_name") && (sfilter & ~(StateFilterOK | StateFilterWarning | StateFilterCritical | StateFilterUnknown)) != 0) {
|
||||||
ConfigCompilerContext::GetInstance()->AddMessage(true, "Validation failed for " +
|
ConfigCompilerContext::GetInstance()->AddMessage(true, "Validation failed for " +
|
||||||
location + ": State filter is invalid.");
|
location + ": State filter is invalid for service dependency.");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -275,7 +275,9 @@
|
|||||||
|
|
||||||
%attribute %name(TimePeriod) "period",
|
%attribute %name(TimePeriod) "period",
|
||||||
|
|
||||||
%attribute %number "state_filter",
|
%attribute %array "state_filter" {
|
||||||
|
%attribute %number "*"
|
||||||
|
},
|
||||||
%attribute %number "disable_checks",
|
%attribute %number "disable_checks",
|
||||||
%attribute %number "disable_notifications"
|
%attribute %number "disable_notifications"
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user