Age | Commit message (Collapse) | Author | Files | Lines |
|
inline is not required on member methods. Clang-tidy has a check for
this. Enable the check and fix the two bad usages.
Tested: Code compiles.
Change-Id: I3115b7c0c4005e1082e0005b818fbe6569511f49
Signed-off-by: Ed Tanous <ed@tanous.net>
|
|
clang-18 improves this check so that we can actually use it. Enable it
and fix all violations.
Change-Id: Ibe4ce19c423d447a4cbe593d1abba948362426af
Signed-off-by: Ed Tanous <ed@tanous.net>
|
|
Redfish protocol validatator has SSE tests that expose some bad coding
practies in SSE handlers, namely, that there are several cases where we
don't check for nullptr.
Fix them.
This appears to have been introduced in:
https://gerrit.openbmc.org/c/openbmc/bmcweb/+/41319
Tested: Redfish service validator passes more tests.
Change-Id: Id980725f007d044b7d120dbe0f4b625865cab6ba
Signed-off-by: Ed Tanous <ed@tanous.net>
|
|
The commit:
b5f288d Make use of filebody for dump offload
Caused a minor failure in clearing responses, where open file handles
wouldn't be closed in between queries, resulting in the next read to
return empty content. This caused redfish protocol validator to fail.
boost::beast::http::response::clear() documentation shows that it only
clears the headers, not the file body. Now normally, this doesn't
matter, because bmcweb completely replaces the response body when a new
response is driven, but not in the case of files.
Add response.body().clear() during the clear to ensure the response is
cleared.
In addition, add encodingType to the clear() call, to ensure that it is
reset as well. This is a bug, but I don't know the reproduction steps.
Tested: Redfish protocol validator now completes (with SSE failures)
Change-Id: Ice6d5085003034a1bed48397ddc6316e9cd0536f
Signed-off-by: Ed Tanous <ed@tanous.net>
|
|
When we have an internal error, having the D-Bus response is really
helpful. Follow our guide and have these be a Logging Level Error.
Tested: None. Inspection only.
Change-Id: Ie1d9f364c3af7f2a8839d878d68c82c10ddc0429
Signed-off-by: Gunnar Mills <gmills@us.ibm.com>
|
|
Most of this code was written before bmcweb had a logger, and
therefore used cout/cerr.
This commit greps the codebase and finds all places where we still
use cout/cerr, and moves them to logging.
Tested: Inspection only. No functional changes.
Change-Id: I5ce1883c9941e80203ec29decb3a0206fd118506
Signed-off-by: Ed Tanous <ed@tanous.net>
|
|
This commit changes sdbusplus setProperty calls in ethernet.hpp file
to "setDbusProperty" method in Redfish namespace that handles all DBus
errors in a consistent manner.
Tested By:
Tested a few PATCH operations on the redfish endpoints defined in
this file and verified that bmcweb returns appropriate Redfish
errors.
Change-Id: Ie456db75d59dc247cdce5dd5cc0b2f6894f5265f
Signed-off-by: Asmitha Karunanithi <asmitk01@in.ibm.com>
|
|
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>
|
|
And fix the includes that are wrong.
Note, there is a very large ignore list included in the .clang-tidy
configcfile. These are things that clang-tidy doesn't yet handle
well, like knowing about a details include.
Change-Id: Ie3744f2c8cba68a8700b406449d6c2018a736952
Signed-off-by: Ed Tanous <ed@tanous.net>
|
|
Current code has
//clang-format on
When it should have
// clang-format on
The difference is subtle, but disables formatting for this whole file.
Re-enable and fix the couple of problems.
Tested: Whitespace only.
Change-Id: Ia155226327d4d611eb2c0f5232274459866e81cc
Signed-off-by: Ed Tanous <ed@tanous.net>
|
|
These classes accidentally overlapped in naming with the nghttp2
classes. This is because this class, unlike most nghttp2 classes
doesn't end in _ptr for a type. This changes the class name to add a
_ex to differentiate the two classes, and avoid a warning in clang.
Tested: Unit tests pass. Code only used in unit test.
Change-Id: I91a6982264df69bc65166ab38feddc21f72cd223
Signed-off-by: Ed Tanous <ed@tanous.net>
|
|
Enable the checks we pass already.
This also removes the commented out misc-no-recursion, considering we
don't pass it.
Tested: Clang-tidy passes.
Change-Id: Ibaed95677aed85188bff483d2cd53605faaf7cc6
Signed-off-by: Ed Tanous <ed@tanous.net>
|
|
Another clang version, another set of checks we can enable.
bmcweb passes all these checks today, so enable them to help
folks write better code.
Change-Id: Ied6a364ee92d8d634edea717cfa2fb5245d534f9
Signed-off-by: Ed Tanous <ed@tanous.net>
|
|
clang-tidy-18 makes this feature stable enough for us to use in general.
Enable the check, and fix the couple of regressions that have snuck in
since we last ran the check.
Tidy seems to not be able to understand that ASSERT will not continue,
so if we ASSERT a std::optional, it's not a bug. Add explicit checks to
keep tidy happy.
Tested: clang-tidy passes.
Change-Id: I0986453851da5471056a7b47b8ad57a9801df259
Signed-off-by: Ed Tanous <ed@tanous.net>
|
|
It's not clear how this came to be the way it is, but tidy now warns
that this variable is unused (which it is).
Refactor the LDAP code to not use the variable, and to use concrete
object_t and array_t
Tested: Redfish service validator passes.
Change-Id: I0c106d10594a396d506bf9865cb29d4a10a372a1
Signed-off-by: Ed Tanous <ed@tanous.net>
|
|
Extend the hasIndicatorLed array and add
xyz.openbmc_project.Inventory.Item.Chassis interface.
Tested:
```
curl -k https://$bmc/redfish/v1/Chassis/chassis
{
"@odata.id": "/redfish/v1/Chassis/chassis",
"@odata.type": "#Chassis.v1_22_0.Chassis",
"Actions": {
"#Chassis.Reset": {
"@Redfish.ActionInfo": "/redfish/v1/Chassis/chassis/ResetActionInfo",
"target": "/redfish/v1/Chassis/chassis/Actions/Chassis.Reset"
}
},
"ChassisType": "RackMount",
"Id": "chassis",
"Links": {
"ComputerSystems": [
{
"@odata.id": "/redfish/v1/Systems/system"
}
],
"ManagedBy": [
{
"@odata.id": "/redfish/v1/Managers/bmc"
}
]
},
"Location": {
"PartLocation": {
"ServiceLabel": "U78DA.ND0.WZS004K"
}
},
"IndicatorLED": "Off",
"LocationIndicatorActive": false,
"Manufacturer": "",
"Model": "23",
"Name": "chassis",
"PCIeDevices": {
"@odata.id": "/redfish/v1/Systems/system/PCIeDevices"
},
"PartNumber": "",
"Power": {
"@odata.id": "/redfish/v1/Chassis/chassis/Power"
},
"PowerState": "Off",
"Sensors": {
"@odata.id": "/redfish/v1/Chassis/chassis/Sensors"
},
"SerialNumber": "",
"Status": {
"Health": "OK",
"HealthRollup": "OK",
"State": "StandbyOffline"
},
"Thermal": {
"@odata.id": "/redfish/v1/Chassis/chassis/Thermal"
}
}
```
Signed-off-by: George Liu <liuxiwei@ieisystem.com>
Change-Id: I02e77d56e555f9aee3f76015baeebbf1f4a292ab
|
|
These variables aren't used, and clang-tidy-18 flags it. Remove
Tested: Code compiles.
Change-Id: I414c4614a5f789aecab7700a4ec805e98c09cade
Signed-off-by: Ed Tanous <ed@tanous.net>
|
|
bugprone-multi-level-implicit-pointer-conversion is something that we
pass currently, with one exception in the deprecated rest API. Ignore
the one exception, as it's not clear how to fix it, and enable the
check.
Tested: Clang tidy passes.
Change-Id: Idc10e0bb7b876e1c70afa28f9c27cc7bef1db0d7
Signed-off-by: Ed Tanous <ed@tanous.net>
|
|
clang-tidy-18 must've fixed their checking for these in headers.
Resolve as the robot commands.
Tested: Noop changes made by tidy. Code compiles.
Change-Id: I1de7686c597deffb0df91c30dae1a29f9ba7900e
Signed-off-by: Ed Tanous <ed@tanous.net>
|
|
Change-Id: I0133bbd0a7573bd3d1e3c3c99382442b286696f6
Signed-off-by: Ed Tanous <ed@tanous.net>
|
|
Quite often do I compile this project, and see an error message that
makes no sense. Multiple times I've seen posted about compiler errors
that amount to using an old version of clang or gcc.
Explicitly require clang-17 and gcc-13 in the meson config, and give
better errors if they're not present.
This also allows simplifying our warning flags (which probably need
a review soon) by making two sets of flags, one for each compiler.
Note, clang has the -Weverything flag, which we use, so explicitly
enabling warnings isn't really required, only disabling the ones
that we don't use.
Tested: Code compiles.
Change-Id: I09fa74e6d36feaf05710a4bb7d266f80ff1cc592
Signed-off-by: Ed Tanous <ed@tanous.net>
|
|
This code was copied from one of the nghttp2 examples, and makes things
more complicated than they should be. We only handle one case here, so
a pattern of returning early is easier.
Also, this resolves a possible clang-tidy bugprone warning (that we
don't yet enable).
Tested: Http2 unit tests pass (good coverage for this case).
Change-Id: Ie8606872f3a96f1bb0329bf22a4f7429f431bbef
Signed-off-by: Ed Tanous <ed@tanous.net>
|
|
If one sets the XSS policy disable, and tries to load the webui, they're
met with the following error message:
```
chunk-vendors.6cfb4b74.js:36 Refused to load the image
'data:image/svg+xml;charset=utf-8,%3Csvg
xmlns='http://www.w3.org/2000/svg' width='4' height='5'%3E%3Cpath
fill='%233f3f3f' d='M2 0L0 2h4zm0 5L0 3h4z'/%3E%3C/svg%3E' because it
violates the following Content Security Policy directive: "img-src *".
Note that '*' matches only URLs with network schemes ('http', 'https',
'ws', 'wss'), or URLs whose scheme matches `self`'s scheme. The scheme
'data:' must be added explicitly.
```
Do as it asks, and add data: to the content security policy.
Tested: Browser console no longer shows error when XSS is enabled.
Change-Id: I17f70d7c87a284b33ef6eb5a01a01c23a14898c9
Signed-off-by: Ed Tanous <ed@tanous.net>
|
|
This reverts commit cd40b060ee2df5469077a70d15590f86158f2c60.
Cookie based login is no longer functional with this patch. It looks
like we got a merge conflict that I resolved incorrectly.
Tested: Webui can now log in.
Change-Id: I60b8aeae173b1838d8745a2c499fbcb410813ef3
|
|
This allows http2 connections to now host authenticated endpoints.
Note, this work exposed that the http2 path was not calling
preparePayload() and responses were therefore missing the
Content-Length header. preparePayload is now called, and Content-Length
is added to the unit tests.
This commit also allows a full Redfish Service Validator test to pass
entirely using HTTP2.
Tested: Unit tests pass.
Curl /redfish/v1/Managers/bmc/LogServices/Journal/Entries
(which returns a payload larger than 16kB) succeeds and returns the
data.
Manually logging in with both basic and session authentication succeeds
over http2.
A modified Redfish-Service-Validator, changed to use httpx as its
backend, (thus using http2) succeeds.
Change-Id: I956f3ff8f442e9826312c6147d7599ab136a8e7c
Signed-off-by: Ed Tanous <ed@tanous.net>
|
|
We don't have any routes that use 5 wildcards, but clearly someone uses
it because of the bug #270. There's no reason not to fix this.
Ideally we would support an arbitrary number of wildcards, but that's a
template problem for another day.
Tested: No way to test, inspection only.
Change-Id: I5de75f5288124e84c153518966d658e1c899f6d5
Signed-off-by: Ed Tanous <ed@tanous.net>
|
|
For the content type header
application/json;charset=utf-8
The Redfish specification DSP0266 shows no space between the ; and
charset. Sites like mozilla show the space included [1]
Considering the discrepancy, we should just accept both.
Resolves #271
[1] https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Content-Type
Tested: Submitter reports issue fixed.
Change-Id: I77b7db91d65acc84f2221ec50985d4b942fbe77f
Signed-off-by: Ed Tanous <ed@tanous.net>
|
|
Use multiple level direct read.
Tested: Visual only. Need help if anyone wants to test.
Change-Id: I8655e74d39edcbab43fcd2a8379b085e91ed00eb
Signed-off-by: Ed Tanous <ed@tanous.net>
|
|
Use multiple level direct read
Tested: Visual only. Need help if anyone wants to test.
Change-Id: I2595a7024f1d02e02874310d1911cd4855b867be
Signed-off-by: Ed Tanous <ed@tanous.net>
|
|
Change-Id: Idc37e3e98296cf59aa6fab499a27d7ed899b71dd
Signed-off-by: Ed Tanous <ed@tanous.net>
|
|
Change-Id: If4237a21aa0c5f414e20cd9e7eee2f1188097e14
Signed-off-by: Ed Tanous <ed@tanous.net>
|
|
Change-Id: I29a9ecbdc9011b6513dc6bfccd28e7e7158fed9b
Signed-off-by: Ed Tanous <ed@tanous.net>
|
|
Change-Id: I2e72f01821e931a8d6eeb812c314de9d1c52df78
Signed-off-by: Ed Tanous <ed@tanous.net>
|
|
Change-Id: I69ed29472b209e8782be63c3f0f2e8ca63dc14a4
Signed-off-by: Ed Tanous <ed@tanous.net>
|
|
Use multiple level direct read to simplify code.
Tested: Visual only. Need help if anyone wants to test.
Change-Id: Ib7c34daefbe2bb835cbe420b40861f27442d05b1
Signed-off-by: Ed Tanous <ed@tanous.net>
|
|
Similar to other places where we've ported the depth-based readJson
support forward, this commit ports the UpdateService handler to simplify
the code.
Signed-off-by: Ed Tanous <edtanous@google.com>
Change-Id: Ia9841a10b4414f81205d3f9b49ec8aab8f9d491d
|
|
Historically, logging has been disabled in bmcweb for two reasons.
First, the crow logging handler used iostreams, which can bloat binary
sizes if there are lots of logging call sites.
Second, the amount of logging and the levels at which is was performed
were not very carefully selected by either crow, or the follow on
bmcweb. A number of log calls logged at Error or Critical level that
are fully expected to occur in a normally operating service.
The first was corrected with commit 62598e3, which replaced the
iostreams logger with c++20 compliant std::format.
The second was corrected by Gunnar, documenting when and where to log
different levels in commit 0e88cb3, and a series of commits after
making the levels usage more consistent.
With those two changes in place and showing the appearance of being
functional, this patchset is recommending that we change the default
error level to log Critical and Error levels by default.
A number of organizations have already made this change to their local
systems [1], opting for varying levels. Given that we're now internally
consistent, this is going to request that we modify those systems to
accept defaults once again.
There are two negatives to this being the default.
1. We take a 2.7% increase (about 27KB) in binary size. Given the last
couple years of reductions in the default binary size, this shouldn't
cause any platforms to go over their flash limit, and we're still well
within the documented size targets.
2. Error paths now log, which slows down the result, and increases the
potential that a DOS attack or test will slow down real results. This
concern is hypothetical at best, but we will have to watch for repeated
patterns emerging and evaluate if this is a potential problem.
Please comment.
[1] https://github.com/search?q=repo%3Aopenbmc%2Fopenbmc%20bmcweb-logging&type=code
Change-Id: Ib32654c3bcbcbee567f3bd7abd003411dd9e489a
Signed-off-by: Ed Tanous <ed@tanous.net>
|
|
Redfish supports several type systems for json. This makes parsing into
proper types a challenge. Nlohmann supports 3 core data types,
nlohmann::json, which supports all json types (float, int, array,
object). Nlohmann::json::object_t, which is a specific typedef of
std::map, and nlohmann::json::array_t, which is a specific typedef of
std::map.
Redfish allows reading our arrays of complex objects, similar to
NtpServers: [null, {}, "string"]
Which makes it a challenge to support. This commit allows parsing out
objects as a nlohmann::object_t, which gives the ability to later use it
in a type safe manner, without having to call
get_ptr<nlohmann::json::object_t later>.
Tested:
Unit tests pass.
Change-Id: I4134338951ce27c2f56841a45b56bc64ad1753db
Signed-off-by: Ed Tanous <ed@tanous.net>
|
|
Now that our custom body type does things more than files, it makes
sense to rename it. This commit renames the header itself, then all
instances of the class.
Tested: Basic GET requests succeed.
Change-Id: If4361ac8992fc7c268f48a336707f96e68d3576c
Signed-off-by: Ed Tanous <ed@tanous.net>
|
|
Internally inside phosphor-time-manager, the elapsed(uint64) dbus call
just forwards the request directly to systemd after static casting to
int64_t (signed).
bmcweb should just call systemd directly, for several reasons.
phosphor-timesyncd might block on other calls, given it's a single
threaded blocking design, due to bugs like #264. Calling systemd
directly means that calls that don't require phosphor networkd won't be
blocked.
Calling systemd directly allows bmcweb to drop some code that parses a
date as int64_t, then converts it to uint64_t to fulfill the phosphor
datetime interface. We can now keep int64_t all the way through.
Calling systemd directly allows bmcweb to give a more specific error
code in the case there NTP is enabled, registering a
PropertyValueConflict error, instead of a 500 InternalError.
Tested:
Patching DateTime property with NTP enabled returns 400,
PropertyValueConflict
```
curl -vvvv -k --user "root:0penBmc" -H "Content-Type: application/json" -X PATCH -d '{"DateTime":"2020-12-15T15:40:52+00:00"}' https://192.168.7.2/redfish/v1/Managers/bmc
```
Disabling NTP using the following command:
```
curl -vvvv -k --user "root:0penBmc" -H "Content-Type: application/json" -X PATCH -d '{"NTP":{"ProtocolEnabled":false}}' https://192.168.7.2/redfish/v1/Managers/bmc/NetworkProtocol
```
Allows the prior command to succeed.
[1] https://github.com/openbmc/phosphor-time-manager/blob/5ce9ac0e56440312997b25771507585905e8b360/bmc_epoch.cpp#L126
Change-Id: I6fbb6f63e17de8ab847ca5ed4eadc2bd313586d2
Signed-off-by: Ed Tanous <ed@tanous.net>
|
|
Remove some inline lambdas. This should have no impact on function,
code was just moved.
4 tiers of inline lambdas are now down to 2. Ideally should be 1.
Tested: Thank you Gaurav!
Appears to work as intended.
Change-Id: I3acd0b77bc59ece4ed5ecde5fe4257dc903456fb
Signed-off-by: Ed Tanous <ed@tanous.net>
|
|
Writing this test exposed some bugs in SSE that got merged.
sendSSEHeader was never called, leading to a connection that starts
and immediately closes with no error code.
This issue has been corrected in code, such that the sockets start.
To allow for unit tests, the io_service needs to be passed into the
class, previously, the SSE connection was pulling the io_context from
the DBus connection, which is odd, given that the SSE connection has
no other dependencies on DBus.
Unit tests should help keep it working.
Tested: Unit tests pass.
Change-Id: I48080d2a94b6349989f556cd1c7b103bad498526
Signed-off-by: Ed Tanous <ed@tanous.net>
|
|
We have lots of commits that ignore documentation. While I don't like
what this does to commit messages, and I don't like the toil it creates,
I suspect it will get patches onto master faster.
I'd like input from submitters if they think this will help.
Signed-off-by: Ed Tanous <edtanous@google.com>
Change-Id: I27edaf3ea059b21ff54d737e5b8e8981756228f6
|
|
Break out this method into a smaller section.
Tested: Redfish service validator passes
Change-Id: I0ca4e9ea14c505a1ed00dae4cba1285e4ac1f36d
Signed-off-by: Ed Tanous <edtanous@google.com>
|
|
This is the same version yocto uses.
Tested: Code compiles
Change-Id: I3bf7be18ecd0e5863ab8afd57748f918837ba5a3
Signed-off-by: Ed Tanous <ed@tanous.net>
|
|
The interface name is being loaded incorrectly which causes the DBus
call to fail resulting in Internal server error.
This commit changes the interface to the correct name.
This is a regression caused by ea2b670d306d85d6975b6174024985491af04a89
TESTED:
- PATCH /redfish/v1/Managers/bmc with below body succeeded
{
"Oem": {
"OpenBmc": {
"Fan": {
"FanZones": {
"Left": {
"MinThermalOutput": 30.0
}
}
}
}
}
}
Change-Id: I0bcf858cd541dc11e802431ad983954a57d8c790
Signed-off-by: PavanKumarIntel <pavanx.kumar.martha@intel.com>
|
|
The commit removes current support that assumes 1:1 system:Chassis for
Chassis/PCIeDevices.
Current implementation populates the same collection of PCIeDevices
with chassis and with system.
Since the path is /redfish/v1/Systems/system/PCIeDevices and we already
have a link from /redfish/v1/Systems/system/, removing the link here in
Chassis.
The link from Chassis to /redfish/v1/Systems/system/PCIeDevices is
unexpected.
For systems with multiple chassis the current assumption does not hold
true. It breaks there, as it assumes all PCIeDevices are in all Chassis.
This is just a link and since another link from system resource already
exists. The case of walking the whole tree isn't broke.
And so, this should not break clients.
Validator has been executed with no new errors.
Signed-off-by: Sunny Srivastava <sunnsr25@in.ibm.com>
Change-Id: Id3af01ec99708c36b5fff2a63f04ffd722f6c3a2
Signed-off-by: Alpana Kumari <alpankum@in.ibm.com>
|
|
This link has been broken for a while. Fix it.
Change-Id: I01bb10e5831f0128db0cd6d0be82ac610c2c1564
Signed-off-by: Ed Tanous <ed@tanous.net>
|
|
According to the Redfish Data Model specification the correct parameter
name for the '/Actions/Manager.ResetToDefaults' action is not
'ResetToDefaults' but 'ResetType'.
The mistake was originally introduced in the commit "Redfish: Manager:
ResetToDefault" (3e40fc742265c3ec1384e7e5994e62aed356331f).
Change parameter name to match with the specification.
Leave some support for the old parameter name to keep the compatibility
with the old clients.
Tested:
The POST request
/redfish/v1/Managers/bmc/Actions/Manager.ResetToDefaults
with {"ResetType": "ResetAll"} body accepted successfully.
Redfish validator passed.
Change-Id: I6aab20314f85dbda16ad3758091de8822943b761
Signed-off-by: Konstantin Aladyshev <aladyshev22@gmail.com>
|
|
As hinted at in the usage example [1], the destination range must
have sufficient size to contain the elements.
If the destination range has size 0, then it will be empty after the
function call. Then the "Name" property in powersupply json will be ""
and there will only be one powersupply because of the deduplication
code.
Tested: Powersupplies appear as usual
References:
[1] https://en.cppreference.com/w/cpp/algorithm/ranges/replace_copy
Change-Id: I81dd21a2dd6eb9b29a67007d6d6229d3a752690f
Signed-off-by: Alexander Hansen <alexander.hansen@9elements.com>
|