summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAdriana Kobylak <anoo@us.ibm.com>2018-12-10 13:45:09 -0600
committerAdriana Kobylak <anoo@us.ibm.com>2018-12-11 08:21:31 -0600
commit3b6a4cd700a60a1e4c969900e87a5e58512ebc89 (patch)
tree88de0b03d0c65250bda59ac8277a000dc39872d8
parent02516d3ff949271de661666353aa87ee06d74cce (diff)
downloadphosphor-bmc-code-mgmt-3b6a4cd700a60a1e4c969900e87a5e58512ebc89.zip
phosphor-bmc-code-mgmt-3b6a4cd700a60a1e4c969900e87a5e58512ebc89.tar.gz
Remove deprecated is_method_error code
The is_method_error() function is no longer needed, instead a try-catch block should be used instead. Reference: https://lists.ozlabs.org/pipermail/openbmc/2018-October/013696.html, Change-Id: I1919ea33fc18be2b8afd51fb1f85ddef15041e7c Signed-off-by: Adriana Kobylak <anoo@us.ibm.com>
-rw-r--r--activation.cpp8
-rw-r--r--ubi/item_updater_helper.cpp18
2 files changed, 17 insertions, 9 deletions
diff --git a/activation.cpp b/activation.cpp
index a938b8b..73acc3d 100644
--- a/activation.cpp
+++ b/activation.cpp
@@ -205,9 +205,11 @@ void Activation::deleteImageManagerObject()
auto method = this->bus.new_method_call(VERSION_BUSNAME, path.c_str(),
"xyz.openbmc_project.Object.Delete",
"Delete");
- auto mapperResponseMsg = bus.call(method);
- // Check that the bus call didn't result in an error
- if (mapperResponseMsg.is_method_error())
+ try
+ {
+ bus.call_noreply(method);
+ }
+ catch (const SdBusError& e)
{
log<level::ERR>("Error in Deleting image from image manager",
entry("VERSIONPATH=%s", path.c_str()));
diff --git a/ubi/item_updater_helper.cpp b/ubi/item_updater_helper.cpp
index 68162cb..a699d5f 100644
--- a/ubi/item_updater_helper.cpp
+++ b/ubi/item_updater_helper.cpp
@@ -3,6 +3,7 @@
#include "item_updater_helper.hpp"
#include <phosphor-logging/log.hpp>
+#include <sdbusplus/exception.hpp>
namespace phosphor
{
@@ -12,6 +13,7 @@ namespace updater
{
using namespace phosphor::logging;
+using sdbusplus::exception::SdBusError;
void Helper::setEntry(const std::string& entryId, uint8_t value)
{
@@ -69,10 +71,12 @@ void Helper::updateUbootVersionId(const std::string& versionId)
auto updateEnvVarsFile =
"obmc-flash-bmc-updateubootvars@" + versionId + ".service";
method.append(updateEnvVarsFile, "replace");
- auto result = bus.call(method);
- // Check that the bus call didn't result in an error
- if (result.is_method_error())
+ try
+ {
+ bus.call_noreply(method);
+ }
+ catch (const SdBusError& e)
{
log<level::ERR>("Failed to update u-boot env variables",
entry("VERSIONID=%s", versionId.c_str()));
@@ -105,10 +109,12 @@ void Helper::mirrorAlt()
SYSTEMD_INTERFACE, "StartUnit");
auto mirrorUbootFile = "obmc-flash-bmc-mirroruboot.service";
method.append(mirrorUbootFile, "replace");
- auto result = bus.call(method);
- // Check that the bus call didn't result in an error
- if (result.is_method_error())
+ try
+ {
+ bus.call_noreply(method);
+ }
+ catch (const SdBusError& e)
{
log<level::ERR>("Failed to copy U-Boot to alternate chip");
}
OpenPOWER on IntegriCloud