Create active association
Create an association between an active image
and the active image's version object.
Resolves openbmc/openbmc#2007
Change-Id: I4fd27235db97a3cee87d2da335245e00ec602fba
Signed-off-by: Gunnar Mills <gmills@us.ibm.com>
diff --git a/item_updater.cpp b/item_updater.cpp
index 7d7df3f..4b8d534 100644
--- a/item_updater.cpp
+++ b/item_updater.cpp
@@ -441,6 +441,30 @@
}
}
+void ItemUpdater::createActiveAssociation(std::string path)
+{
+ assocs.emplace_back(std::make_tuple(ACTIVE_FWD_ASSOCIATION,
+ ACTIVE_REV_ASSOCIATION,
+ path));
+ associations(assocs);
+}
+
+void ItemUpdater::removeActiveAssociation(std::string path)
+{
+ for (auto iter = assocs.begin(); iter != assocs.end();)
+ {
+ if ((std::get<2>(*iter)).compare(path) == 0)
+ {
+ iter = assocs.erase(iter);
+ associations(assocs);
+ }
+ else
+ {
+ ++iter;
+ }
+ }
+}
+
} // namespace updater
} // namespace software
} // namespace phosphor