regulators: Allow empty expected VPD value
Modify the compare_vpd action to support specifying an empty string or
empty byte vector as the expected keyword value.
The VPD service was modified in a previous commit to return an empty
keyword value if the VPD interface or keyword does not exist on the
specified D-Bus object path. Thus, the actual keyword value may be
empty.
Signed-off-by: Shawn McCarney <shawnmm@us.ibm.com>
Change-Id: If48ab6423c40e5b24d6cff72264dc2efe750c85f
diff --git a/phosphor-regulators/src/config_file_parser.cpp b/phosphor-regulators/src/config_file_parser.cpp
index db0cd7a..3eecbb6 100644
--- a/phosphor-regulators/src/config_file_parser.cpp
+++ b/phosphor-regulators/src/config_file_parser.cpp
@@ -287,7 +287,7 @@
auto byteValuesIt = element.find("byte_values");
if ((valueIt != element.end()) && (byteValuesIt == element.end()))
{
- std::string stringValue = parseString(*valueIt);
+ std::string stringValue = parseString(*valueIt, true);
value.insert(value.begin(), stringValue.begin(), stringValue.end());
++propertyCount;
}