History log of /openbmc/bmcweb/redfish-core/src/utils/dbus_utils.cpp (Results 1 – 10 of 10)
Revision Date Author Comments
# 40e9b92e 10-Sep-2024 Ed Tanous <etanous@nvidia.com>

Use SPDX identifiers

SPDX identifiers are simpler, and reduce the amount of cruft we have in
code files. They are recommended by linux foundation, and therefore we
should do as they allow.

This pa

Use SPDX identifiers

SPDX identifiers are simpler, and reduce the amount of cruft we have in
code files. They are recommended by linux foundation, and therefore we
should do as they allow.

This patchset does not intend to modify any intent on any existing
copyrights or licenses, only to standardize their inclusion.

[1] https://www.linuxfoundation.org/blog/blog/copyright-notices-in-open-source-software-projects

Change-Id: I935c7c0156caa78fc368c929cebd0f068031e830
Signed-off-by: Ed Tanous <etanous@nvidia.com>

show more ...


# 5900d4c3 10-Oct-2024 Patrick Williams <patrick@stwcx.xyz>

clang-tidy: add misc-include-cleaner fixes

Fix the following clang-tidy errors:
```
../redfish-core/src/filter_expr_executor.cpp:102:21: error: no header providing "nlohmann::json" is directly inclu

clang-tidy: add misc-include-cleaner fixes

Fix the following clang-tidy errors:
```
../redfish-core/src/filter_expr_executor.cpp:102:21: error: no header providing "nlohmann::json" is directly included [misc-include-cleaner,-warnings-as-errors]
7 | const nlohmann::json& body;
```

Signed-off-by: Patrick Williams <patrick@stwcx.xyz>
Change-Id: I2e0d66bb35c1010607b9795d00b3321dc20d6d65

show more ...


# 247ae89b 21-Aug-2024 Ed Tanous <etanous@nvidia.com>

Make PATCH return 204 again

It was correctly pointed out that for PATCH, we cannot return 200
success without also returning the object, per Redfish. This commit
partially reverts cdf25ff, to give

Make PATCH return 204 again

It was correctly pointed out that for PATCH, we cannot return 200
success without also returning the object, per Redfish. This commit
partially reverts cdf25ff, to give PATCH the old (204) behavior again.

Tested: Patch now returns 204

Change-Id: I8ede932a73ae064586d94c47393e4418350adb00
Signed-off-by: Ed Tanous <etanous@nvidia.com>

show more ...


# bd79bce8 16-Aug-2024 Patrick Williams <patrick@stwcx.xyz>

clang-format: re-format for clang-18

clang-format-18 isn't compatible with the clang-format-17 output, so we
need to reformat the code with the latest version. The way clang-18
handles lambda forma

clang-format: re-format for clang-18

clang-format-18 isn't compatible with the clang-format-17 output, so we
need to reformat the code with the latest version. The way clang-18
handles lambda formatting also changed, so we have made changes to the
organization default style format to better handle lambda formatting.

See I5e08687e696dd240402a2780158664b7113def0e for updated style.
See Iea0776aaa7edd483fa395e23de25ebf5a6288f71 for clang-18 enablement.

Change-Id: Iceec1dc95b6c908ec6c21fb40093de9dd18bf11a
Signed-off-by: Patrick Williams <patrick@stwcx.xyz>

show more ...


# cdf25ffb 12-Jul-2024 Ed Tanous <ed@tanous.net>

Make set properties return 200 Success not 204

Both 200 and 204 are allowed by the Redfish specification. Table 11
states:

200 OK Success, and the action's schema definition does not contain an
ac

Make set properties return 200 Success not 204

Both 200 and 204 are allowed by the Redfish specification. Table 11
states:

200 OK Success, and the action's schema definition does not contain an
action response.

204 No Content: Success, and the action's schema definition does not
contain an action response.

While both of these are allowed, we accidentally changed behavior in the
following commit:
87c4496 Move to Redfish setProperty call

When we transitioned these over to the common dbus calling methods.

This commit restores the old behavior of returning 200 success on
actions, which some implementations are expecting.

Tested: WIP.

Change-Id: I02e47585acf85bd04dcb9d428ef3e39a21d9c75f
Signed-off-by: Ed Tanous <ed@tanous.net>

show more ...


# 95c6307a 26-Mar-2024 Ed Tanous <ed@tanous.net>

Break out formatters

In the change made to move to std::format, we defined some custom type
formatters in logging.hpp. This had the unintended effect of making
all compile units pull in the majorit

Break out formatters

In the change made to move to std::format, we defined some custom type
formatters in logging.hpp. This had the unintended effect of making
all compile units pull in the majority of boost::url, and nlohmann::json
as includes.

This commit breaks out boost and json formatters into their own separate
includes.

Tested: Code compiles. Logging changes only.

Change-Id: I6a788533169f10e19130a1910cd3be0cc729b020
Signed-off-by: Ed Tanous <ed@tanous.net>

show more ...


# 5b90429a 16-Apr-2024 Ed Tanous <ed@tanous.net>

Add missing headers

Most of these were found by breaking every redfish class handler into
its own compile unit:

When that's done, these missing headers become compile errors. We
should just fix the

Add missing headers

Most of these were found by breaking every redfish class handler into
its own compile unit:

When that's done, these missing headers become compile errors. We
should just fix them.

In addition, this allows us to enable automatic header checking in
clang-tidy using misc-header-cleaner. Because the compiler can now
"see" all the defines, it no longer tries to remove headers that it
thinks are unused.

[1] https://github.com/openbmc/bmcweb/commit/4fdee9e39e9f03122ee16a6fb251a380681f56ac

Tested: Code compiles.

Change-Id: Ifa27ac4a512362b7ded7cc3068648dc4aea6ad7b
Signed-off-by: Ed Tanous <ed@tanous.net>

show more ...


# 87c44966 04-Apr-2024 Asmitha Karunanithi <asmitk01@in.ibm.com>

Move to Redfish setProperty call

This commit changes sdbusplus setProperty calls (in various files) to
setDbusProperty method in Redfish namespace that handles all DBus
errors in a consistent manner

Move to Redfish setProperty call

This commit changes sdbusplus setProperty calls (in various files) to
setDbusProperty method in Redfish namespace that handles all DBus
errors in a consistent manner.

It also handles and translates additional DBus errors to Redfish
specific errors in dbus_utils file.

Tested By:
Not tested yet

Change-Id: If440774879413754f4c24f9b6572c3c9fa1fd033
Signed-off-by: Asmitha Karunanithi <asmitk01@in.ibm.com>

show more ...


# 1827b4f1 03-Apr-2024 Asmitha Karunanithi <asmitk01@in.ibm.com>

Move to Redfish Action specific setProperty call

This commit will migrate all the setProperty calls initiated by a
redfish"Action" to "setDbusProperty" method in Redfish namespace that
handles all D

Move to Redfish Action specific setProperty call

This commit will migrate all the setProperty calls initiated by a
redfish"Action" to "setDbusProperty" method in Redfish namespace that
handles all DBuserrors in a consistent manner.

This method will determine if a setProperty is called during redfish
"Action" or just setting of a dbus property and internally call
appropriate methods that handles different set of errors.

All the Redfish action specific errors are defined in error_messages.hpp
file.
This specific change moves setProperty call in hypervisor_system.hpp and
covers errors in the mentioned file only.

Tested-By:
<Yet to test this usecase>

Change-Id: I3da48fbeabcdcf088c4481021232f08a44797c86
Signed-off-by: Asmitha Karunanithi <asmitk01@in.ibm.com>
Signed-off-by: Ed Tanous <ed@tanous.net>

show more ...


# d02aad39 13-Feb-2024 Ed Tanous <ed@tanous.net>

Create Redfish specific setProperty call

There are currently 78 sdbusplus::asio::setProperty calls in
redfish-core. The error handler for nearly all of them looks something
like:

```
if (ec)
{

Create Redfish specific setProperty call

There are currently 78 sdbusplus::asio::setProperty calls in
redfish-core. The error handler for nearly all of them looks something
like:

```
if (ec)
{
const sd_bus_error* dbusError = msg.get_error();
if ((dbusError != nullptr) &&
(dbusError->name ==
std::string_view(
"xyz.openbmc_project.Common.Error.InvalidArgument")))
{
BMCWEB_LOG_WARNING("DBUS response error: {}", ec);
messages::propertyValueIncorrect(asyncResp->res, "<PropertyName>", <PropertyValue>);
return;
}
messages::internalError(asyncResp->res);
return;
}
messages::success(asyncResp->res);

```

In some cases there are more errors handled that translate to more error
messages, but the vast majority only handle InvalidArgument. Many of
these, like the ones in account_service.hpp, do the error handling in a
lambda, which causes readability problems. This commit starts to make
things more consistent, and easier for trivial property sets.

This commit invents a setDbusProperty method in the redfish namespace
that tries to handle all DBus errors in a consistent manner. Looking
for input on whether this will work before changing over the other 73
calls. Overall this is less code, fewer inline lambdas, and defaults
that should work for MOST use cases of calling an OpenBMC daemon, and
fall back to more generic errors when calling a "normal" dbus daemon.

As part of this, I've ported over several examples. Some things that
might be up in the air:
1. Do we always return 204 no_content on property sets? Today there's a
mix of 200, with a Base::Success message, and 204, with an empty body.
2. Do all DBus response codes map to the same error? A majority are
covered by xyz.openbmc_project.Common.Error.InvalidArgument, but there
are likely differences. If we allow any daemon to return any return
code, does that cause compatibility problems later?

Tested:
```
curl -k --user "root:0penBmc" -H "Content-Type: application/json" -X PATCH -d '{"HostName":"openbmc@#"}' https://192.168.7.2/redfish/v1/Managers/bmc/EthernetInterfaces/eth0
```

Returns the appropriate error in the response
Base.1.16.0.PropertyValueIncorrect

Change-Id: If033a1112ba516792c9386c997d090c8f9094f3a
Signed-off-by: Ed Tanous <ed@tanous.net>

show more ...