Refactor: Make Activation inherit FilePath interface

Previously Version inherits FilePath interface to provide the
information of the file path property of a software, and Activation was
using pre-defined location to find the image path (IMG_DIR / versionId).

Now the code is going to support pre-built image and stored image during
update, the Activation class needs to know the file path to perform the
update.

So this commit "moves" the FilePath from Version to Activation.

Tested: Verify the "Path" property on FilePath still exists on the DBus
        object after uploading a tarball.

Signed-off-by: Lei YU <mine260309@gmail.com>
Change-Id: I37b41eaa93cd239ab7732f6fac9400410995ca71
diff --git a/src/item_updater.cpp b/src/item_updater.cpp
index 49b95df..8d5695c 100644
--- a/src/item_updater.cpp
+++ b/src/item_updater.cpp
@@ -112,12 +112,13 @@
             extendedVersion = it->second;
         }
 
-        auto activation = createActivationObject(
-            path, versionId, extendedVersion, activationState, associations);
+        auto activation =
+            createActivationObject(path, versionId, extendedVersion,
+                                   activationState, associations, filePath);
         activations.emplace(versionId, std::move(activation));
 
         auto versionPtr =
-            createVersionObject(path, versionId, version, purpose, filePath);
+            createVersionObject(path, versionId, version, purpose);
         versions.emplace(versionId, std::move(versionPtr));
     }
     return;
@@ -188,10 +189,11 @@
     const std::string& extVersion,
     sdbusplus::xyz::openbmc_project::Software::server::Activation::Activations
         activationStatus,
-    const AssociationList& assocs)
+    const AssociationList& assocs, const std::string& filePath)
 {
     return std::make_unique<Activation>(bus, path, versionId, extVersion,
-                                        activationStatus, assocs, this);
+                                        activationStatus, assocs, this,
+                                        filePath);
 }
 
 void ItemUpdater::createPsuObject(const std::string& psuInventoryPath,
@@ -221,13 +223,13 @@
                                                   ACTIVATION_REV_ASSOCIATION,
                                                   psuInventoryPath));
 
-        auto activation = createActivationObject(path, versionId, "",
-                                                 activationState, associations);
+        auto activation = createActivationObject(
+            path, versionId, "", activationState, associations, "");
         activations.emplace(versionId, std::move(activation));
         psuPathActivationMap.emplace(psuInventoryPath, activations[versionId]);
 
         auto versionPtr = createVersionObject(path, versionId, psuVersion,
-                                              VersionPurpose::PSU, "");
+                                              VersionPurpose::PSU);
         versions.emplace(versionId, std::move(versionPtr));
 
         createActiveAssociation(path);
@@ -275,11 +277,10 @@
     const std::string& objPath, const std::string& versionId,
     const std::string& versionString,
     sdbusplus::xyz::openbmc_project::Software::server::Version::VersionPurpose
-        versionPurpose,
-    const std::string& filePath)
+        versionPurpose)
 {
     auto version = std::make_unique<Version>(
-        bus, objPath, versionId, versionString, versionPurpose, filePath,
+        bus, objPath, versionId, versionString, versionPurpose,
         std::bind(&ItemUpdater::erase, this, std::placeholders::_1));
     return version;
 }