Apply LambdaBodyIndentation to dbus-sensors
Per the transform being done in bmcweb, do the same for dbus-sensors.
Signed-off-by: Ed Tanous <edtanous@google.com>
Change-Id: If21489607759f3cdf20fad17eede50fb4e228e5e
diff --git a/include/Utils.hpp b/include/Utils.hpp
index 0a89d13..05a36a3 100644
--- a/include/Utils.hpp
+++ b/include/Utils.hpp
@@ -177,10 +177,10 @@
{
conn->async_method_call(
[name](const boost::system::error_code ec) {
- if (ec)
- {
- std::cerr << "Failed to set LED " << name << "\n";
- }
+ if (ec)
+ {
+ std::cerr << "Failed to set LED " << name << "\n";
+ }
},
"xyz.openbmc_project.LED.GroupManager",
"/xyz/openbmc_project/led/groups/" + name, properties::interface,
@@ -217,30 +217,30 @@
retries](const boost::system::error_code ec,
boost::container::flat_map<std::string, BasicVariantType>&
data) {
- if (ec)
+ if (ec)
+ {
+ std::cerr << "Error getting " << path << ": retries left"
+ << retries - 1 << "\n";
+ if (!retries)
{
- std::cerr << "Error getting " << path << ": retries left"
- << retries - 1 << "\n";
- if (!retries)
- {
- return;
- }
- auto timer = std::make_shared<boost::asio::steady_timer>(
- self->dbusConnection->get_io_context());
- timer->expires_after(std::chrono::seconds(10));
- timer->async_wait([self, timer, path, interface, owner,
- retries](boost::system::error_code ec) {
- if (ec)
- {
- std::cerr << "Timer error!\n";
- return;
- }
- self->getPath(path, interface, owner, retries - 1);
- });
return;
}
+ auto timer = std::make_shared<boost::asio::steady_timer>(
+ self->dbusConnection->get_io_context());
+ timer->expires_after(std::chrono::seconds(10));
+ timer->async_wait([self, timer, path, interface, owner,
+ retries](boost::system::error_code ec) {
+ if (ec)
+ {
+ std::cerr << "Timer error!\n";
+ return;
+ }
+ self->getPath(path, interface, owner, retries - 1);
+ });
+ return;
+ }
- self->respData[path][interface] = std::move(data);
+ self->respData[path][interface] = std::move(data);
},
owner, path, "org.freedesktop.DBus.Properties", "GetAll",
interface);
@@ -258,52 +258,50 @@
dbusConnection->async_method_call(
[self, interfaces, retries](const boost::system::error_code ec,
const GetSubTreeType& ret) {
- if (ec)
+ if (ec)
+ {
+ std::cerr << "Error calling mapper\n";
+ if (!retries)
{
- std::cerr << "Error calling mapper\n";
- if (!retries)
- {
- return;
- }
- auto timer = std::make_shared<boost::asio::steady_timer>(
- self->dbusConnection->get_io_context());
- timer->expires_after(std::chrono::seconds(10));
- timer->async_wait([self, timer, interfaces,
- retries](boost::system::error_code ec) {
- if (ec)
- {
- std::cerr << "Timer error!\n";
- return;
- }
- self->getConfiguration(interfaces, retries - 1);
- });
-
return;
}
- for (const auto& [path, objDict] : ret)
- {
- if (objDict.empty())
+ auto timer = std::make_shared<boost::asio::steady_timer>(
+ self->dbusConnection->get_io_context());
+ timer->expires_after(std::chrono::seconds(10));
+ timer->async_wait([self, timer, interfaces,
+ retries](boost::system::error_code ec) {
+ if (ec)
{
+ std::cerr << "Timer error!\n";
return;
}
- const std::string& owner = objDict.begin()->first;
+ self->getConfiguration(interfaces, retries - 1);
+ });
- for (const std::string& interface : objDict.begin()->second)
- {
- // anything that starts with a requested configuration
- // is good
- if (std::find_if(
- interfaces.begin(), interfaces.end(),
- [interface](const std::string& possible) {
- return boost::starts_with(interface,
- possible);
- }) == interfaces.end())
- {
- continue;
- }
- self->getPath(path, interface, owner);
- }
+ return;
+ }
+ for (const auto& [path, objDict] : ret)
+ {
+ if (objDict.empty())
+ {
+ return;
}
+ const std::string& owner = objDict.begin()->first;
+
+ for (const std::string& interface : objDict.begin()->second)
+ {
+ // anything that starts with a requested configuration
+ // is good
+ if (std::find_if(interfaces.begin(), interfaces.end(),
+ [interface](const std::string& possible) {
+ return boost::starts_with(interface, possible);
+ }) == interfaces.end())
+ {
+ continue;
+ }
+ self->getPath(path, interface, owner);
+ }
+ }
},
mapper::busName, mapper::path, mapper::interface, mapper::subtree,
"/", 0, interfaces);