Activation: remove old objects after update done
The update on PSUs is one-by-one, after each PSU is updated, notify
ItemUpdater by onUpdateDone() so that the old object for the PSU is
removed.
Tested: With dummy PSU image and update service, verify the old
objects are removed on Witherspoon.
Change-Id: I212b8cba9570ad96083d362bf57691fdabb4e42f
diff --git a/src/item_updater.hpp b/src/item_updater.hpp
index b713454..c3da8f9 100644
--- a/src/item_updater.hpp
+++ b/src/item_updater.hpp
@@ -35,7 +35,9 @@
/** @class ItemUpdater
* @brief Manages the activation of the PSU version items.
*/
-class ItemUpdater : public ItemUpdaterInherit, public AssociationInterface
+class ItemUpdater : public ItemUpdaterInherit,
+ public AssociationInterface,
+ public ActivationListener
{
friend class ::TestItemUpdater;
@@ -84,6 +86,14 @@
*/
void removeAssociation(const std::string& path) override;
+ /** @brief Notify a PSU is updated
+ *
+ * @param[in] versionId - The versionId of the activation
+ * @param[in] psuInventoryPath - The PSU inventory path that is updated
+ */
+ void onUpdateDone(const std::string& versionId,
+ const std::string& psuInventoryPath) override;
+
private:
/** @brief Callback function for Software.Version match.
* @details Creates an Activation D-Bus object.