Use xyz interface to update VPD collection status
This commit adds code to use xyz.openbmc_project.Common.Progress
interface instead of the com.ibm.VPD.Collection to update VPD
collection status of the FRU.
Output:
```
Tested on rainier system:
During inventory priming, observed Status as below #
Status updated as NotStarted:
root@p11bmc:~# busctl get-property xyz.openbmc_project.Inventory.Manager /xyz/openbmc_project/inventory/system/chassis/motherboard/tpm_wilson xyz.openbmc_project.Common.Progress Status
s "xyz.openbmc_project.Common.Progress.OperationStatus.NotStarted"
Status updated as InProgress:
root@p11bmc:~# busctl get-property xyz.openbmc_project.Inventory.Manager /xyz/openbmc_project/inventory/system/chassis/motherboard/tpm_wilson xyz.openbmc_project.Common.Progress Status
s "xyz.openbmc_project.Common.Progress.OperationStatus.InProgress"
Status updated as Completed:
root@p11bmc:~# busctl get-property xyz.openbmc_project.Inventory.Manager /xyz/openbmc_project/inventory/system/chassis/motherboard/tpm_wilson xyz.openbmc_project.Common.Progress Status
s "xyz.openbmc_project.Common.Progress.OperationStatus.Completed"
root@p11bmc:~#
FRU whose VPD collection is failed:
After Priming -
root@p11bmc:~# busctl get-property xyz.openbmc_project.Inventory.Manager /xyz/openbmc_project/inventory/system/chassis/motherboard/dimm14 xyz.openbmc_project.Common.Progress Status
s "xyz.openbmc_project.Common.Progress.OperationStatus.NotStarted"
After VPD collection failed -
root@p11bmc:~# busctl get-property xyz.openbmc_project.Inventory.Manager /xyz/openbmc_project/inventory/system/chassis/motherboard/dimm14 xyz.openbmc_project.Common.Progress Status
s "xyz.openbmc_project.Common.Progress.OperationStatus.Failed"
Collection status update during deleteFRUVPD #
Before delete -
root@p11bmc:~# busctl get-property xyz.openbmc_project.Inventory.Manager /xyz/openbmc_project/inventory/system/chassis/motherboard/pcieslot10/pcie_card10 xyz.openbmc_project.Common.Progress Status; busctl get-property xyz.openbmc_project.Inventory.Manager /xyz/openbmc_project/inventory/system/chassis/motherboard/pcieslot10/pcie_card10/c10_connector0 xyz.openbmc_project.Common.Progress Status; busctl get-property xyz.openbmc_project.Inventory.Manager /xyz/openbmc_project/inventory/system/chassis/motherboard/pcieslot10/pcie_card10/c10_connector1 xyz.openbmc_project.Common.Progress Status; busctl get-property xyz.openbmc_project.Inventory.Manager /xyz/openbmc_project/inventory/system/chassis/motherboard/pcieslot10/pcie_card10/c10_connector2 xyz.openbmc_project.Common.Progress Status; busctl get-property xyz.openbmc_project.Inventory.Manager /xyz/openbmc_project/inventory/system/chassis/motherboard/pcieslot10/pcie_card10/c10_connector3 xyz.openbmc_project.Common.Progress Status
s "xyz.openbmc_project.Common.Progress.OperationStatus.Completed"
s "xyz.openbmc_project.Common.Progress.OperationStatus.Completed"
s "xyz.openbmc_project.Common.Progress.OperationStatus.Completed"
s "xyz.openbmc_project.Common.Progress.OperationStatus.Completed"
s "xyz.openbmc_project.Common.Progress.OperationStatus.Completed"
After delete operation -
root@p11bmc:~# busctl get-property xyz.openbmc_project.Inventory.Manager /xyz/openbmc_project/inventory/system/chassis/motherboard/pcieslot10/pcie_card10 xyz.openbmc_project.Common.Progress Status; busctl get-property xyz.openbmc_project.Inventory.Manager /xyz/openbmc_project/inventory/system/chassis/motherboard/pcieslot10/pcie_card10/c10_connector0 xyz.openbmc_project.Common.Progress Status; busctl get-property xyz.openbmc_project.Inventory.Manager /xyz/openbmc_project/inventory/system/chassis/motherboard/pcieslot10/pcie_card10/c10_connector1 xyz.openbmc_project.Common.Progress Status; busctl get-property xyz.openbmc_project.Inventory.Manager /xyz/openbmc_project/inventory/system/chassis/motherboard/pcieslot10/pcie_card10/c10_connector2 xyz.openbmc_project.Common.Progress Status; busctl get-property xyz.openbmc_project.Inventory.Manager /xyz/openbmc_project/inventory/system/chassis/motherboard/pcieslot10/pcie_card10/c10_connector3 xyz.openbmc_project.Common.Progress Status
s "xyz.openbmc_project.Common.Progress.OperationStatus.NotStarted"
s "xyz.openbmc_project.Common.Progress.OperationStatus.NotStarted"
s "xyz.openbmc_project.Common.Progress.OperationStatus.NotStarted"
s "xyz.openbmc_project.Common.Progress.OperationStatus.NotStarted"
s "xyz.openbmc_project.Common.Progress.OperationStatus.NotStarted"
Collection status update during CollectFRUVPD #
Before collection:
root@p11bmc:~# busctl get-property xyz.openbmc_project.Inventory.Manager /xyz/openbmc_project/inventory/system/chassis/motherboard/lcd_op_panel_hill xyz.openbmc_project.Common.Progress Status
s "xyz.openbmc_project.Common.Progress.OperationStatus.Completed"
After CollectFRUVPD method call -
root@p11bmc:~# busctl call com.ibm.VPD.Manager /com/ibm/VPD/Manager com.ibm.VPD.Manager CollectFRUVPD o "/xyz/openbmc_project/inventory/system/chassis/motherboard/lcd_op_panel_hill"
Status updated as below during the process –
root@p11bmc:~# busctl get-property xyz.openbmc_project.Inventory.Manager /xyz/openbmc_project/inventory/system/chassis/motherboard/lcd_op_panel_hill xyz.openbmc_project.Common.Progress Status
s "xyz.openbmc_project.Common.Progress.OperationStatus.InProgress"
root@p11bmc:~# busctl get-property xyz.openbmc_project.Inventory.Manager /xyz/openbmc_project/inventory/system/chassis/motherboard/lcd_op_panel_hill xyz.openbmc_project.Common.Progress Status
s "xyz.openbmc_project.Common.Progress.OperationStatus.Completed"
```
Change-Id: I705e10e80b90df9bac338e8b5475d95690e05ace
Signed-off-by: Anupama B R <anupama.b.r1@ibm.com>
diff --git a/vpd-manager/src/worker.cpp b/vpd-manager/src/worker.cpp
index 789a240..dc46b98 100644
--- a/vpd-manager/src/worker.cpp
+++ b/vpd-manager/src/worker.cpp
@@ -745,7 +745,7 @@
// Emplace the default state of FRU VPD collection
types::PropertyMap l_fruCollectionProperty = {
- {"CollectionStatus", constants::vpdCollectionNotStarted}};
+ {"Status", constants::vpdCollectionNotStarted}};
vpdSpecificUtility::insertOrMerge(l_interfaces,
constants::vpdCollectionInterface,
@@ -1046,7 +1046,7 @@
// Update collection status as successful
types::PropertyMap l_collectionProperty = {
- {"CollectionStatus", constants::vpdCollectionSuccess}};
+ {"Status", constants::vpdCollectionCompleted}};
vpdSpecificUtility::insertOrMerge(interfaces,
constants::vpdCollectionInterface,
@@ -1369,7 +1369,7 @@
m_activeCollectionThreadCount++;
m_mutex.unlock();
- // Set CollectionStatus as InProgress. Since it's an intermediate state
+ // Set collection Status as InProgress. Since it's an intermediate state
// D-bus set-property call is good enough to update the status.
l_inventoryPath = jsonUtility::getInventoryObjPathFromJson(
m_parsedJson, i_vpdFilePath);
@@ -1379,11 +1379,11 @@
if (!dbusUtility::writeDbusProperty(
jsonUtility::getServiceName(m_parsedJson, l_inventoryPath),
l_inventoryPath, constants::vpdCollectionInterface,
- "CollectionStatus",
+ "Status",
types::DbusVariantType{constants::vpdCollectionInProgress}))
{
logging::logMessage(
- "Unable to set CollectionStatus as InProgress for " +
+ "Unable to set collection Status as InProgress for " +
i_vpdFilePath + ". Error : " + "DBus write failed");
}
}
@@ -1411,7 +1411,7 @@
catch (const std::exception& ex)
{
setCollectionStatusProperty(i_vpdFilePath,
- constants::vpdCollectionFailure);
+ constants::vpdCollectionFailed);
// handle all the exceptions internally. Return only true/false
// based on status of execution.
@@ -1869,9 +1869,9 @@
}
}
- // Set CollectionStatus as InProgress. Since it's an intermediate state
+ // Set collection Status as InProgress. Since it's an intermediate state
// D-bus set-property call is good enough to update the status.
- const std::string& l_collStatusProp = "CollectionStatus";
+ const std::string& l_collStatusProp = "Status";
if (!dbusUtility::writeDbusProperty(
jsonUtility::getServiceName(m_parsedJson,
@@ -1881,7 +1881,7 @@
types::DbusVariantType{constants::vpdCollectionInProgress}))
{
logging::logMessage(
- "Unable to set CollectionStatus as InProgress for " +
+ "Unable to set collection Status as InProgress for " +
std::string(i_dbusObjPath) +
". Continue single FRU VPD collection.");
}
@@ -1917,12 +1917,12 @@
}
catch (const std::exception& l_error)
{
- // Notify FRU's VPD CollectionStatus as Failure
+ // Notify FRU's VPD collection Status as Failed
if (!dbusUtility::notifyFRUCollectionStatus(
- std::string(i_dbusObjPath), constants::vpdCollectionFailure))
+ std::string(i_dbusObjPath), constants::vpdCollectionFailed))
{
logging::logMessage(
- "Call to PIM Notify method failed to update Collection status as Failure for " +
+ "Call to PIM Notify method failed to update collection Status as Failed for " +
std::string(i_dbusObjPath));
}
@@ -1939,7 +1939,7 @@
if (i_vpdPath.empty())
{
throw std::runtime_error(
- "Given path is empty. Can't set CollectionStatus property");
+ "Given path is empty. Can't set collection Status property");
}
types::ObjectMap l_objectInterfaceMap;
@@ -1952,7 +1952,7 @@
l_Fru["inventoryPath"]);
types::PropertyMap l_propertyValueMap;
- l_propertyValueMap.emplace("CollectionStatus", i_value);
+ l_propertyValueMap.emplace("Status", i_value);
types::InterfaceMap l_interfaces;
vpdSpecificUtility::insertOrMerge(
@@ -1970,11 +1970,11 @@
{
throw std::runtime_error(
"Invalid inventory path: " + i_vpdPath +
- ". Can't set CollectionStatus property");
+ ". Can't set collection Status property");
}
types::PropertyMap l_propertyValueMap;
- l_propertyValueMap.emplace("CollectionStatus", i_value);
+ l_propertyValueMap.emplace("Status", i_value);
types::InterfaceMap l_interfaces;
vpdSpecificUtility::insertOrMerge(l_interfaces,
@@ -1989,7 +1989,7 @@
{
throw DbusException(
std::string(__FUNCTION__) +
- "Call to PIM failed while setting CollectionStatus property for path " +
+ "Call to PIM failed while setting collection Status property for path " +
i_vpdPath);
}
}