Require all probe interface properties to match
If multiple properties were provided for a probe interface rule, the
match would succeed if the last property (as iterated over by a map)
were a match. This commit changes the logic to require all properties to
match.
Tested: Added second (invalid) property value to baseboard.json
FruDevice rule, and verified that the baseboard was no longer presented
by entity-manager after making this change.
Signed-off-by: Jonathan Doman <jonathan.doman@intel.com>
Change-Id: I2b65d0bedb7e0f193c784cdb292653e00cbb34a3
diff --git a/src/EntityManager.cpp b/src/EntityManager.cpp
index 744bcf8..b36610b 100644
--- a/src/EntityManager.cpp
+++ b/src/EntityManager.cpp
@@ -311,7 +311,8 @@
auto deviceValue = properties.find(matchProp);
if (deviceValue != properties.end())
{
- deviceMatches = matchProbe(matchJSON, deviceValue->second);
+ deviceMatches =
+ deviceMatches && matchProbe(matchJSON, deviceValue->second);
}
else
{