intel-ipmi-oem: Fixing bios.xml parsing
The main fix is the change translate 'sif','gif','dif' from 'IF' to 'IF
NOT'. Now all bios knobs with depex equal "TRUE" will be visible over
RF.
Tested: manually checked on platform, all knobs with depex set as "TRUE"
are visible over RF. PSYS bios knobs are visible and it is possible to
set them over redfish.
Change-Id: I684fb29f9feb50df7a48aa77a79fad11943dd055
Signed-off-by: Jatkiewicz, Joanna <joanna.jatkiewicz@intel.com>
diff --git a/include/biosxml.hpp b/include/biosxml.hpp
index d2a584d..8881fdf 100644
--- a/include/biosxml.hpp
+++ b/include/biosxml.hpp
@@ -302,7 +302,14 @@
{
if (cnt > 3)
{
- subExpression += " OR ";
+ if (operatorStr == "_EQU_" || operatorStr == "EQU")
+ {
+ subExpression += " OR ";
+ }
+ if (operatorStr == "_NEQ_" || operatorStr == "NEQ")
+ {
+ subExpression += " AND ";
+ }
}
subExpression += "( ";
@@ -496,6 +503,7 @@
size_t i;
int value;
+ bool ifFormSetOperator = false;
std::stack<int> values;
std::stack<knob::DepexOperators> operators;
std::string subExpression;
@@ -587,6 +595,10 @@
* by taking the inner/sub expression and evaluating it */
if (word.back() == '(')
{
+ if (word == "Sif(" || word == "Gif(" || word == "Dif(")
+ {
+ ifFormSetOperator = true;
+ }
if (!getSubExpression(expression, subExpression, i))
break;
@@ -612,7 +624,7 @@
{
try
{
- value = std::stoi(word);
+ value = std::stoi(word, nullptr, 0);
}
catch (const std::exception& ex)
{
@@ -627,6 +639,12 @@
break;
}
+ /* 'Sif(', 'Gif(', 'Dif( == IF NOT,
+ we have to negate the vaule */
+ if (ifFormSetOperator == true)
+ {
+ value = !value;
+ }
values.emplace(value);
}
}