-
Notifications
You must be signed in to change notification settings - Fork 20
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Implement vpd-tool dumpObject stub #501
base: 1110
Are you sure you want to change the base?
Conversation
This commit includes changes and new files required for implementation of vpd-tool --dumpObject and --dumpInventory options. Change-Id: I821777237a3080d390e2bba151cd685ef8994bf9 Signed-off-by: Souvik Roy <[email protected]>
255b227
to
46ace05
Compare
This commit is not just for dump object and dump inventory. this is an initial setup required for vpd-tool APIs. Can you please update the commit heading and the description. |
This commit includes changes and new files required for implementation of vpd-tool APIs. Change-Id: I821777237a3080d390e2bba151cd685ef8994bf9 Signed-off-by: Souvik Roy <[email protected]>
46ace05
to
8abb7f0
Compare
Done |
This commit includes changes and new files required for implementation of vpd-tool APIs. Change-Id: I821777237a3080d390e2bba151cd685ef8994bf9 Signed-off-by: Souvik Roy <[email protected]>
8abb7f0
to
c110e39
Compare
The commit message is not giving any hint of why and what this commit is doing. |
Can you mention what is not clear? So that I can update the commit message accordingly. |
This commit includes changes and new source code files required for implementation of vpd-tool APIs. Change-Id: I821777237a3080d390e2bba151cd685ef8994bf9 Signed-off-by: Souvik Roy <[email protected]>
c110e39
to
4fd701e
Compare
This commit includes changes and new source code files required for implementation of vpd-tool APIs. Change-Id: I821777237a3080d390e2bba151cd685ef8994bf9 Signed-off-by: Souvik Roy <[email protected]>
This commit includes changes and new source code files required for implementation of vpd-tool APIs. Change-Id: I821777237a3080d390e2bba151cd685ef8994bf9 Signed-off-by: Souvik Roy <[email protected]>
4fd701e
to
4f0b6b1
Compare
This commit includes changes and new source code files required for implementation of vpd-tool APIs. Change-Id: I821777237a3080d390e2bba151cd685ef8994bf9 Signed-off-by: Souvik Roy <[email protected]>
4f0b6b1
to
3e2f9fb
Compare
This commit includes changes and new source code files required for implementation of vpd-tool APIs. Change-Id: I821777237a3080d390e2bba151cd685ef8994bf9 Signed-off-by: Souvik Roy <[email protected]>
This commit includes changes and new source code files required for implementation of vpd-tool APIs. Change-Id: I821777237a3080d390e2bba151cd685ef8994bf9 Signed-off-by: Souvik Roy <[email protected]>
3e2f9fb
to
f3bd78b
Compare
This commit implements vpd-tool --dumpObject stub and some associated utility methods and constants for the same. This commit allows user to provide --dumpObject command line option to vpd-tool. Note: This commit does not include actual implementation of --dumpObject. Change-Id: I821777237a3080d390e2bba151cd685ef8994bf9 Signed-off-by: Souvik Roy <[email protected]>
5a0f5e8
to
78db080
Compare
This commit implements vpd-tool --dumpObject stub and some associated utility methods and constants for the same. This commit allows user to provide --dumpObject command line option to vpd-tool. Note: This commit does not include actual implementation of --dumpObject. Change-Id: I821777237a3080d390e2bba151cd685ef8994bf9 Signed-off-by: Souvik Roy <[email protected]>
78db080
to
3b0a111
Compare
This commit implements vpd-tool --dumpObject stub and some associated utility methods and constants for the same. This commit allows user to provide --dumpObject command line option to vpd-tool. Note: This commit does not include actual implementation of --dumpObject. Change-Id: I821777237a3080d390e2bba151cd685ef8994bf9 Signed-off-by: Souvik Roy <[email protected]>
3b0a111
to
52e42e2
Compare
This commit implements vpd-tool --dumpObject stub and some associated utility methods and constants for the same. This commit allows user to provide --dumpObject command line option to vpd-tool. Note: This commit does not include actual implementation of --dumpObject. Change-Id: I821777237a3080d390e2bba151cd685ef8994bf9 Signed-off-by: Souvik Roy <[email protected]>
52e42e2
to
52836c3
Compare
This commit implements vpd-tool --dumpObject stub and some associated utility methods and constants for the same. This commit allows user to provide --dumpObject command line option to vpd-tool. Note: This commit does not include actual implementation of --dumpObject. Change-Id: I821777237a3080d390e2bba151cd685ef8994bf9 Signed-off-by: Souvik Roy <[email protected]>
52836c3
to
46f24dd
Compare
This commit implements vpd-tool --dumpObject stub and some associated utility methods and constants for the same. This commit allows user to provide --dumpObject command line option to vpd-tool. Note: This commit does not include actual implementation of --dumpObject. Change-Id: I821777237a3080d390e2bba151cd685ef8994bf9 Signed-off-by: Souvik Roy <[email protected]>
46f24dd
to
2b0ee20
Compare
This commit implements vpd-tool --dumpObject stub and some associated utility methods and constants for the same. This commit allows user to provide --dumpObject command line option to vpd-tool. Note: This commit does not include actual implementation of --dumpObject. Change-Id: I821777237a3080d390e2bba151cd685ef8994bf9 Signed-off-by: Souvik Roy <[email protected]>
2b0ee20
to
47e30cc
Compare
* Note: The caller of this API should | ||
* check for empty JSON object | ||
* | ||
* @throw std::runtime_error |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
on error scenarios - sometimes you throw exception and sometimes you return empty JSON object. can we fix with any one ?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
on failure empty JSON should be sent ?
vpd-tool/src/vpd_tool.cpp
Outdated
{ | ||
nlohmann::json l_resultInJson = nlohmann::json::array({}); | ||
const nlohmann::json& l_sysCfgJsonObj = | ||
vpd::jsonUtility::getParsedJson(INVENTORY_JSON_SYM_LINK); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
getParsedJson() throws exception. can you catch the exception here and take necessary action in this API?
necessary action llike - catch the exception and return empty json from here.
vpd-tool/include/vpd_tool.hpp
Outdated
* | ||
* @throw std::runtime_error | ||
*/ | ||
nlohmann::json getFruPropertiesJson(const std::string& i_fruPath) const; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
name doesn't gives the clarity on what this API is.
can you change it to something like - getFruProperties() -> as return type tells the format, it's not required to mention JSON format in API name.
vpd-tool/src/vpd_tool_main.cpp
Outdated
@@ -46,6 +51,9 @@ int main(int argc, char** argv) | |||
auto l_hardwareFlag = l_app.add_flag("--Hardware, -H", | |||
"CAUTION: Developer only option."); | |||
|
|||
auto l_dumpObjFlag = l_app.add_flag("--dumpObject, -o", "Dump Object") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Description something like : "Dump inventory object properties."
vpd-tool/meson.build
Outdated
@@ -13,7 +13,7 @@ sources = ['src/vpd_tool_main.cpp', | |||
|
|||
vpd_tool_exe = executable('vpd-tool', | |||
sources, | |||
include_directories : ['include/'], | |||
include_directories : ['include/','../'], |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
why do you include the directory out of vpd-tool directory? ( ../)
* of the FRU in JSON format to console: | ||
* - Present property, Pretty Name, Location Code, Sub Model | ||
* - SN, PN, CC, FN, DR keywords under VINI record. | ||
* - type and TYPE of the FRU |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
what is type and TYPE of the FRU?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
From the old vpd-tool
,
- "type" property in object dump specifies the first
extraInterfaces
interface name which isnull
.Eg.xyz.openbmc_project.Inventory.Item.Cpu
- "TYPE" tag default value is "FRU", unless there is a "type" tag in the System Config JSON. As per new requirement, since
vpd-tool
doesn't have System Config JSON, I think we may have to skip dumping this "TYPE" tag.
As per discussion on 10th December, 2024, following new design changes need to be implemented in
|
This commit implements vpd-tool --dumpObject stub and some associated utility methods and constants for the same. This commit allows user to provide --dumpObject command line option to vpd-tool. Note: This commit does not include actual implementation of --dumpObject. Change-Id: I821777237a3080d390e2bba151cd685ef8994bf9 Signed-off-by: Souvik Roy <[email protected]>
47e30cc
to
878f6f9
Compare
This commit implements vpd-tool --dumpObject stub and some associated utility methods and constants for the same. This commit allows user to provide --dumpObject command line option to vpd-tool. Note: This commit does not include actual implementation of --dumpObject. Change-Id: I821777237a3080d390e2bba151cd685ef8994bf9 Signed-off-by: Souvik Roy <[email protected]>
878f6f9
to
34ac1af
Compare
This commit implements vpd-tool --dumpObject stub and some associated utility methods and constants for the same. This commit allows user to provide --dumpObject command line option to vpd-tool. Note: This commit does not include actual implementation of --dumpObject. Change-Id: I821777237a3080d390e2bba151cd685ef8994bf9 Signed-off-by: Souvik Roy <[email protected]>
34ac1af
to
715ae69
Compare
This commit implements vpd-tool --dumpObject stub and some associated utility methods and constants for the same. This commit allows user to provide --dumpObject command line option to vpd-tool. Note: This commit does not include actual implementation of --dumpObject. Change-Id: I821777237a3080d390e2bba151cd685ef8994bf9 Signed-off-by: Souvik Roy <[email protected]>
715ae69
to
61a1d31
Compare
"vpd-tool -r -H -O <EEPROM Path> -R <Record Name> -K <Keyword Name> --file <File Path>"); | ||
"vpd-tool -r -H -O <EEPROM Path> -R <Record Name> -K <Keyword Name> --file <File Path>\n" | ||
"Dump Object:\n" | ||
" From dbus to console: " |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
to consistent with existing, use DBus
* Note: The caller of this API should | ||
* check for empty JSON object | ||
* | ||
* @throw std::runtime_error |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
on failure empty JSON should be sent ?
/** | ||
* @brief Dump the given inventory object in JSON format to console. | ||
* | ||
* For a given Object Path of a FRU, this API dumps the following properties |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
object path
else if (!l_dumpObjFlag->empty()) | ||
{ | ||
vpd::VpdTool l_vpdToolObj; | ||
l_rc = l_vpdToolObj.dumpObject(l_vpdPath); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
should we check l_vpdPath is empty, incase if Object path is provided like -O "" ?
} | ||
catch (std::exception& l_ex) | ||
{ | ||
std::cerr << "Dump Object failed for FRU: " << i_fruPath |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
add todo for enable log when verbose is enabled
This commit implements
vpd-tool --dumpObject
stub and some associatedutility methods and constants for the same.
This commit allows user to provide
--dumpObject
command line option tovpd-tool
.For a given Object path, the object dump functionality prints the
following properties in a JSON format to the console: