Activation: Save the version id
Save the version id so that the path doesn't have to be parsed
every time the version id is needed.
Change-Id: Id89ab79bae521e5194cd38d46f73ed983ca200da
Signed-off-by: Adriana Kobylak <anoo@us.ibm.com>
diff --git a/activation.hpp b/activation.hpp
index 4c5bee5..08fba78 100755
--- a/activation.hpp
+++ b/activation.hpp
@@ -28,9 +28,12 @@
*
* @param[in] bus - The Dbus bus object
* @param[in] path - The Dbus object path
+ * @param[in] versionId - The software version id
*/
- Activation(sdbusplus::bus::bus& bus, const std::string& path) :
- ActivationInherit(bus, path.c_str()) {};
+ Activation(sdbusplus::bus::bus& bus, const std::string& path,
+ std::string& versionId) :
+ ActivationInherit(bus, path.c_str()),
+ versionId(versionId) {}
/** @brief Overloaded Activation property setter function
*
@@ -49,6 +52,8 @@
RequestedActivations requestedActivation(RequestedActivations value)
override;
+ /** @brief Version id */
+ std::string versionId;
};
/** @class ActivationBlocksTransition
diff --git a/item_updater.cpp b/item_updater.cpp
index c9df395..ba153e6 100755
--- a/item_updater.cpp
+++ b/item_updater.cpp
@@ -62,7 +62,8 @@
versionId,
std::make_unique<Activation>(
updater->busItem,
- resp)));
+ resp,
+ versionId)));
}
}
return 0;