summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAdriana Kobylak <anoo@us.ibm.com>2018-12-10 13:08:38 -0600
committerAdriana Kobylak <anoo@us.ibm.com>2018-12-11 15:07:12 -0600
commit991af7ecfb579e72613b6c2ab5036a4dc7834636 (patch)
tree1dd316c1c74255b79e2c87d46a9cdc5b5f11e593
parent3b6a4cd700a60a1e4c969900e87a5e58512ebc89 (diff)
downloadphosphor-bmc-code-mgmt-991af7ecfb579e72613b6c2ab5036a4dc7834636.zip
phosphor-bmc-code-mgmt-991af7ecfb579e72613b6c2ab5036a4dc7834636.tar.gz
item_updater: Call remove association on delete
The remove association function was supposed to be called on delete but was never implemented so if the associations are queried but the version has been deleted, that'd be false information, so call to remove the associations on delete, also rename it to delete all associations, because the delete function already determined if the requested version is functional. Tested: Verified the associations for the requested version are deleted with a DeleteAll and Delete call. Change-Id: Ia4fde01c9500b648660bc9a4c355d44a35af7cc5 Signed-off-by: Adriana Kobylak <anoo@us.ibm.com>
-rw-r--r--item_updater.cpp8
-rw-r--r--item_updater.hpp6
2 files changed, 6 insertions, 8 deletions
diff --git a/item_updater.cpp b/item_updater.cpp
index 6dd7a52..173ee29 100644
--- a/item_updater.cpp
+++ b/item_updater.cpp
@@ -324,6 +324,7 @@ void ItemUpdater::erase(std::string entryId)
}
else
{
+ removeAssociations(ita->second->path);
this->activations.erase(entryId);
}
ItemUpdater::resetUbootEnvVars();
@@ -520,14 +521,11 @@ void ItemUpdater::createFunctionalAssociation(const std::string& path)
associations(assocs);
}
-void ItemUpdater::removeActiveAssociation(const std::string& path)
+void ItemUpdater::removeAssociations(const std::string& path)
{
for (auto iter = assocs.begin(); iter != assocs.end();)
{
- // Since there could be multiple associations to the same path,
- // only remove ones that have an active forward association.
- if ((std::get<0>(*iter)).compare(ACTIVE_FWD_ASSOCIATION) == 0 &&
- (std::get<2>(*iter)).compare(path) == 0)
+ if ((std::get<2>(*iter)).compare(path) == 0)
{
iter = assocs.erase(iter);
associations(assocs);
diff --git a/item_updater.hpp b/item_updater.hpp
index ac966ca..aafd66b 100644
--- a/item_updater.hpp
+++ b/item_updater.hpp
@@ -106,11 +106,11 @@ class ItemUpdater : public ItemUpdaterInherit
*/
void createActiveAssociation(const std::string& path);
- /** @brief Removes an active association to the software image
+ /** @brief Removes the associations from the provided software image path
*
- * @param[in] path - The path to remove the association from.
+ * @param[in] path - The path to remove the associations from.
*/
- void removeActiveAssociation(const std::string& path);
+ void removeAssociations(const std::string& path);
/** @brief Determine if the given priority is the lowest
*
OpenPOWER on IntegriCloud