mirror of
https://github.com/Icinga/icinga2.git
synced 2025-07-25 22:54:57 +02:00
parent
4306264217
commit
81b3b48998
@ -37,8 +37,9 @@ bool AttributeFilter::Apply(const Table::Ptr& table, const Value& row)
|
|||||||
Value value = column.ExtractValue(row);
|
Value value = column.ExtractValue(row);
|
||||||
|
|
||||||
if (value.IsObjectType<Array>()) {
|
if (value.IsObjectType<Array>()) {
|
||||||
|
Array::Ptr array = value;
|
||||||
|
|
||||||
if (m_Operator == ">=") {
|
if (m_Operator == ">=") {
|
||||||
Array::Ptr array = value;
|
|
||||||
ObjectLock olock(array);
|
ObjectLock olock(array);
|
||||||
BOOST_FOREACH(const String& item, array) {
|
BOOST_FOREACH(const String& item, array) {
|
||||||
if (item == m_Operand)
|
if (item == m_Operand)
|
||||||
@ -46,8 +47,10 @@ bool AttributeFilter::Apply(const Table::Ptr& table, const Value& row)
|
|||||||
}
|
}
|
||||||
|
|
||||||
return false; /* Item not found in list. */
|
return false; /* Item not found in list. */
|
||||||
|
} else if (m_Operator == "=") {
|
||||||
|
return (array->GetLength() == 0);
|
||||||
} else {
|
} else {
|
||||||
BOOST_THROW_EXCEPTION(std::invalid_argument("Invalid operator for column '" + m_Column + "': " + m_Operator + " (expected '>=')."));
|
BOOST_THROW_EXCEPTION(std::invalid_argument("Invalid operator for column '" + m_Column + "': " + m_Operator + " (expected '>=' or '=')."));
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
if (m_Operator == "=") {
|
if (m_Operator == "=") {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user