-
Notifications
You must be signed in to change notification settings - Fork 21
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
Enable write keyword in backup and restore #385
Enable write keyword in backup and restore #385
Conversation
@@ -157,6 +157,17 @@ void BackupAndRestore::backupAndRestoreIpzVpd(types::IPZVpdMap& io_srcVpdMap, | |||
return; | |||
} | |||
|
|||
const std::string l_srcFruPath = | |||
jsonUtility::getFruPathFromJson(m_sysCfgJsonObj, i_srcPath); |
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 will be the flow if these APIs throws? Should caller handle those or this API should handle that and return to the caller or should the json utility handle that and return empty here?
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.
if backupAndRestoreIpzVpd is completed without exception, at the caller we declaring Backup&Restore is success and also returning the update src & dst vpd map.
Caller is caching the exceptions from backupAndRestore* API's.
I have created the issue (#381) to relook at exceptions handling in backup&restore API's.
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.
ok, on the basis of the issue, I am marking this comment as closed.
Need to revisit to optimize the exception handling in this class.
src/backup_restore.cpp
Outdated
/* To keep the data in sync between hardware and parsed map | ||
updating the io_dstVpdMap. This should only be done if write | ||
on hardware returns success.*/ | ||
std::shared_ptr<Parser> l_vpdParser = |
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.
auto can be used here as well. Also please use a blank line between blocks of code.
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
650492d
to
d56e0f7
Compare
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.
Exception handling needs to be revisited under Issue #381
@@ -157,6 +157,17 @@ void BackupAndRestore::backupAndRestoreIpzVpd(types::IPZVpdMap& io_srcVpdMap, | |||
return; | |||
} | |||
|
|||
const std::string l_srcFruPath = | |||
jsonUtility::getFruPathFromJson(m_sysCfgJsonObj, i_srcPath); |
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.
ok, on the basis of the issue, I am marking this comment as closed.
Need to revisit to optimize the exception handling in this class.
This commit adds the changes to enable write keyword’s value on hardware in the backup & restore functionality. Signed-off-by: Anupama B R <anupama.b.r1@ibm.com>
d56e0f7
to
ba94fbb
Compare
This commit adds the changes to enable write keyword’s value on hardware in the backup & restore functionality.