diff options
author | Gunnar Mills <gmills@us.ibm.com> | 2017-08-28 16:44:52 -0500 |
---|---|---|
committer | Patrick Williams <patrick@stwcx.xyz> | 2017-09-05 15:55:15 +0000 |
commit | ded875dc013c1cd0a98ced68032738946a083819 (patch) | |
tree | 34abee19450fa8e214244bd844072c10d997b70f /item_updater.cpp | |
parent | c7e2d24f5f07e14ece42d6d3e17d5a07203887d9 (diff) | |
download | phosphor-bmc-code-mgmt-ded875dc013c1cd0a98ced68032738946a083819.tar.gz phosphor-bmc-code-mgmt-ded875dc013c1cd0a98ced68032738946a083819.zip |
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>
Diffstat (limited to 'item_updater.cpp')
-rw-r--r-- | item_updater.cpp | 24 |
1 files changed, 24 insertions, 0 deletions
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::setBMCInventoryPath() } } +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 |