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>
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 @@
     }
     else
     {
+        removeAssociations(ita->second->path);
         this->activations.erase(entryId);
     }
     ItemUpdater::resetUbootEnvVars();
@@ -520,14 +521,11 @@
     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);