Increase table width in vpd-tool --fixSystemVPD
This change is required to fit keywords with a
maximum size of 32 bytes. Padded to few more spaces
to fit in keywords larger than 32 bytes.
Test:
Tested on BMC console in GUI.
Table exactly fits in the console. Size cannot be
altered anymore.
Signed-off-by: Priyanga Ramasamy <priyanga24@in.ibm.com>
Change-Id: I7d5da3ffc28045cc5231e9f2625f1462071da7c4
diff --git a/vpd_tool_impl.cpp b/vpd_tool_impl.cpp
index 10eba2e..ae15d71 100644
--- a/vpd_tool_impl.cpp
+++ b/vpd_tool_impl.cpp
@@ -591,21 +591,16 @@
int VpdTool::fixSystemVPD()
{
+ std::string outline(191, '=');
cout << "\nRestorable record-keyword pairs and their data on BMC & "
- "System Backplane.\n ";
-
- cout << "\n|==============================================================="
- "=======================================|"
- << endl;
+ "System Backplane.\n\n"
+ << outline << std::endl;
cout << left << setw(6) << "S.No" << left << setw(8) << "Record" << left
- << setw(9) << "Keyword" << left << setw(30) << "Data On BMC" << left
- << setw(30) << "Data On System Backplane" << left << setw(14)
- << "Data Mismatch";
-
- cout << "\n|==============================================================="
- "=======================================|"
- << endl;
+ << setw(9) << "Keyword" << left << setw(75) << "Data On BMC" << left
+ << setw(75) << "Data On System Backplane" << left << setw(14)
+ << "Data Mismatch\n"
+ << outline << std::endl;
int num = 0;
@@ -756,14 +751,13 @@
}
recKwData.push_back(
make_tuple(++num, record, keyword, busStr, hwValStr, mismatch));
- cout << left << setw(6) << num << left << setw(8) << record << left
- << setw(9) << keyword << left << setw(30) << setfill(' ')
- << busStr << left << setw(30) << setfill(' ') << hwValStr
- << left << setw(14) << mismatch;
- cout << "\n|--------------------------------------------------"
- "----------------------------------------------------|"
- << endl;
+ std::string splitLine(191, '-');
+ cout << left << setw(6) << num << left << setw(8) << record << left
+ << setw(9) << keyword << left << setw(75) << setfill(' ')
+ << busStr << left << setw(75) << setfill(' ') << hwValStr
+ << left << setw(14) << mismatch << '\n'
+ << splitLine << endl;
}
}
parseSVPDOptions(js);
@@ -781,9 +775,9 @@
int option = 0;
cin >> option;
- cout << "\n|==========================================================="
- "===========================================|"
- << endl;
+
+ std::string outline(191, '=');
+ cout << '\n' << outline << endl;
if (json.find("frus") == json.end())
{
@@ -856,28 +850,22 @@
{
do
{
- cout << "\n|==============================================="
- "=================================================="
- "=====|"
- << endl;
+ cout << '\n' << outline << endl;
cout << left << setw(6) << "S.No" << left << setw(8)
<< "Record" << left << setw(9) << "Keyword" << left
- << setw(30) << setfill(' ') << "Data On BMC" << left
- << setw(30) << setfill(' ')
+ << setw(75) << setfill(' ') << "Data On BMC" << left
+ << setw(75) << setfill(' ')
<< "Data On System Backplane" << left << setw(14)
<< "Data Mismatch" << endl;
cout << left << setw(6) << get<0>(data) << left << setw(8)
<< get<1>(data) << left << setw(9) << get<2>(data)
- << left << setw(30) << setfill(' ') << get<3>(data)
- << left << setw(30) << setfill(' ') << get<4>(data)
+ << left << setw(75) << setfill(' ') << get<3>(data)
+ << left << setw(75) << setfill(' ') << get<4>(data)
<< left << setw(14) << get<5>(data);
- cout << "\n|==============================================="
- "=================================================="
- "=====|"
- << endl;
+ cout << '\n' << outline << endl;
if (get<5>(data) == "NO")
{
@@ -897,11 +885,7 @@
}
cin >> option;
-
- cout << "\n|==============================================="
- "=================================================="
- "=====|"
- << endl;
+ cout << '\n' << outline << endl;
EditorImpl edit(constants::systemVpdFilePath, json,
get<1>(data), get<2>(data));
@@ -926,10 +910,7 @@
"System Backplane (Value should be in ASCII or "
"in HEX(prefixed with 0x)) : ";
cin >> value;
- cout << "\n|==========================================="
- "=============================================="
- "=============|"
- << endl;
+ cout << '\n' << outline << endl;
edit.updateKeyword(toBinary(value), 0, true);
cout << "\nData updated successfully.\n";