Remove vpd-manager automatic FRU VPD collection
This commit removes the automatic FRU VPD collection from vpd-manager
flow. Currently, vpd-manager triggers FRU VPD collection after system
VPD has been collected. For PST systems, the FRU VPD collection needs to
be triggered externally from wait-vpd-parsers.service on active BMC
once system has reached a specific state.
Test:
```
- Patch vpd-manager executable into rainiest simics
- Restart vpd-manager
- Observe system VPD is collected but FRU VPD is not started
- Observe FRU VPD CollectionStatus property is "NotStarted"
- Now restart wait-vpd-parsers.service, and observe FRU VPD collection
is started.
- Once wait-vpd-parsers.service exits successfully, observe FRU VPD
CollectionStatus property is "Completed"
```
Change-Id: I74e843b22c41182ef2704f0ae01918678f1fa79d
Signed-off-by: Souvik Roy <souvikroyofficial10@gmail.com>
diff --git a/vpd-manager/oem-handler/ibm_handler.cpp b/vpd-manager/oem-handler/ibm_handler.cpp
index 316184c..debdbca 100644
--- a/vpd-manager/oem-handler/ibm_handler.cpp
+++ b/vpd-manager/oem-handler/ibm_handler.cpp
@@ -65,68 +65,11 @@
m_eventListener->registerHostStateChangeCallback();
m_eventListener->registerPresenceChangeCallback();
- // set async timer to detect if system VPD is published on D-Bus.
- SetTimerToDetectSVPDOnDbus();
-
- // set async timer to detect if VPD collection is done.
- SetTimerToDetectVpdCollectionStatus();
-
// Instantiate GpioMonitor class
m_gpioMonitor =
std::make_shared<GpioMonitor>(m_sysCfgJsonObj, m_worker, m_ioContext);
}
-void IbmHandler::SetTimerToDetectSVPDOnDbus()
-{
- try
- {
- static boost::asio::steady_timer timer(*m_ioContext);
-
- // timer for 2 seconds
- auto asyncCancelled = timer.expires_after(std::chrono::seconds(2));
-
- (asyncCancelled == 0) ? logging::logMessage("Timer started")
- : logging::logMessage("Timer re-started");
-
- timer.async_wait([this](const boost::system::error_code& ec) {
- if (ec == boost::asio::error::operation_aborted)
- {
- throw std::runtime_error(
- std::string(__FUNCTION__) +
- ": Timer to detect system VPD collection status was aborted.");
- }
-
- if (ec)
- {
- throw std::runtime_error(
- std::string(__FUNCTION__) +
- ": Timer to detect System VPD collection failed");
- }
-
- if (m_worker->isSystemVPDOnDBus())
- {
- // cancel the timer
- timer.cancel();
-
- // Triggering FRU VPD collection. Setting status to "In
- // Progress".
- m_progressInterface->set_property(
- "Status", std::string(constants::vpdCollectionInProgress));
- m_worker->collectFrusFromJson();
- }
- });
- }
- catch (const std::exception& l_ex)
- {
- EventLogger::createAsyncPel(
- EventLogger::getErrorType(l_ex), types::SeverityType::Critical,
- __FILE__, __FUNCTION__, 0,
- std::string("Collection for FRUs failed with reason:") +
- EventLogger::getErrorMsg(l_ex),
- std::nullopt, std::nullopt, std::nullopt, std::nullopt);
- }
-}
-
void IbmHandler::SetTimerToDetectVpdCollectionStatus()
{
// Keeping max retry for 2 minutes. TODO: Make it configurable based on
diff --git a/vpd-manager/oem-handler/ibm_handler.hpp b/vpd-manager/oem-handler/ibm_handler.hpp
index e2bf3da..1eb9d3f 100644
--- a/vpd-manager/oem-handler/ibm_handler.hpp
+++ b/vpd-manager/oem-handler/ibm_handler.hpp
@@ -64,19 +64,6 @@
private:
/**
- * @brief API to set timer to detect system VPD over D-Bus.
- *
- * System VPD is required before bus name for VPD-Manager is claimed. Once
- * system VPD is published, VPD for other FRUs should be collected. This API
- * detects id system VPD is already published on D-Bus and based on that
- * triggers VPD collection for rest of the FRUs.
- *
- * Note: Throws exception in case of any failure. Needs to be handled by the
- * caller.
- */
- void SetTimerToDetectSVPDOnDbus();
-
- /**
* @brief Set timer to detect and set VPD collection status for the system.
*
* Collection of FRU VPD is triggered in a separate thread. Resulting in