summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAdriana Kobylak <anoo@us.ibm.com>2018-01-24 13:55:58 -0600
committerAdriana Kobylak <anoo@us.ibm.com>2018-01-24 14:07:56 -0600
commit00bd9029eb06acf34d446c17db4af27a07c52fe0 (patch)
treeff3d98c28ea089d524570d8d38b19310dc8b7bde
parent1254c628c5fcf59e111799a839ab7c132fac7330 (diff)
downloadphosphor-bmc-code-mgmt-00bd9029eb06acf34d446c17db4af27a07c52fe0.tar.gz
phosphor-bmc-code-mgmt-00bd9029eb06acf34d446c17db4af27a07c52fe0.zip
Fix "Error in Deleting image from image manager"
When deleting the updated image from the Version object, the code would query the mapper to get the busname. This call would return 2 busnames, the one for the Activation object and the one for the Version object. Then the code would call Delete on the first busname on the list which would be the Activation one, causing an error because the running image can't be deleted from the Activation object. Instead of querying the mapper for all busnames of a path, and adding logic to figure out which one is the Version one, the updater already knows the Version busname, so just use that directly. Part of openbmc/openbmc#2764 Change-Id: Ia490e11c0fd312fe0c05279964c2cb0c4461ccb3 Signed-off-by: Adriana Kobylak <anoo@us.ibm.com>
-rw-r--r--activation.cpp28
1 files changed, 2 insertions, 26 deletions
diff --git a/activation.cpp b/activation.cpp
index d4ca885..72cc212 100644
--- a/activation.cpp
+++ b/activation.cpp
@@ -127,36 +127,12 @@ auto Activation::activation(Activations value) ->
void Activation::deleteImageManagerObject()
{
- // Get the Delete object for <versionID> inside image_manager
- auto method = this->bus.new_method_call(MAPPER_BUSNAME,
- MAPPER_PATH,
- MAPPER_INTERFACE,
- "GetObject");
- method.append(path);
- method.append(std::vector<std::string>({
- "xyz.openbmc_project.Object.Delete"}));
- auto mapperResponseMsg = bus.call(method);
- if (mapperResponseMsg.is_method_error())
- {
- log<level::ERR>("Error in Get Delete Object",
- entry("VERSIONPATH=%s", path));
- return;
- }
- std::map<std::string, std::vector<std::string>> mapperResponse;
- mapperResponseMsg.read(mapperResponse);
- if (mapperResponse.begin() == mapperResponse.end())
- {
- log<level::ERR>("ERROR in reading the mapper response",
- entry("VERSIONPATH=%s", path));
- return;
- }
-
// Call the Delete object for <versionID> inside image_manager
- method = this->bus.new_method_call((mapperResponse.begin()->first).c_str(),
+ auto method = this->bus.new_method_call(VERSION_BUSNAME,
path.c_str(),
"xyz.openbmc_project.Object.Delete",
"Delete");
- mapperResponseMsg = bus.call(method);
+ auto mapperResponseMsg = bus.call(method);
//Check that the bus call didn't result in an error
if (mapperResponseMsg.is_method_error())
{
OpenPOWER on IntegriCloud