History log of /openbmc/bmcweb/features/redfish/lib/update_service.hpp (Results 101 – 125 of 172)
Revision Date Author Comments
# 1a6e51ae 19-Jan-2022 Jiaqing Zhao <jiaqing.zhao@intel.com>

Fix undefined property in FirmwareInventory

There is an undefined property "Members@odata.count" in /redfish/v1/
UpdateService/FirmwareInventory/{BIOSImage}. This property should be
"RelatedItem@oda

Fix undefined property in FirmwareInventory

There is an undefined property "Members@odata.count" in /redfish/v1/
UpdateService/FirmwareInventory/{BIOSImage}. This property should be
"RelatedItem@odata.count" according to Redfish spec.

Fixes 7e860f1550c8 ("Remove Redfish Node class")

Tested:
Redfish validator passed.

Change-Id: I915295a20a528c2febe244ed2b400ae460392512
Signed-off-by: Jiaqing Zhao <jiaqing.zhao@intel.com>

show more ...


# 8cc8edec 28-Feb-2022 Ed Tanous <edtanous@google.com>

Don't rely on operator << for object logging

In the upcoming fmt patch, we remove the use of streams, and a number of
our logging statements are relying on them. This commit changes them to
no long

Don't rely on operator << for object logging

In the upcoming fmt patch, we remove the use of streams, and a number of
our logging statements are relying on them. This commit changes them to
no longer rely on operator>> or operator+ to build their strings. This
alone isn't very useful, but in the context of the next patch makes the
automation able to do a complete conversion of all log statements
automatically.

Tested: enabled logging on local and saw log statements print to console

Signed-off-by: Ed Tanous <edtanous@google.com>
Change-Id: I0e5dc2cf015c6924037e38d547535eda8175a6a1

show more ...


# ace85d60 26-Oct-2021 Ed Tanous <edtanous@google.com>

Add url type safety to message registry

There are a number of places where we use message registry messages
incorrectly. This patchset attempts to fix them, and invoke some type
safety when they're

Add url type safety to message registry

There are a number of places where we use message registry messages
incorrectly. This patchset attempts to fix them, and invoke some type
safety when they're used such that they're more obvious to use.

Namely, it changes a number of the message registry methods to accept a
boost::urls::url_view for its argument instead of a const std::string&.
This forces the calling code to correctly encode a URL to use the
method, which should make it obvious that it's not for an ID, a property
name, or anything else. In the course of doing this, several places
were found to be using the first argument incorrectly.

Tested:
curl --insecure --user root:0penBmc https://192.168.7.2/redfish/v1/Chassis/foobar

Returns:
{
"error": {
"@Message.ExtendedInfo": [
{
"@odata.type": "#Message.v1_1_1.Message",
"Message": "The requested resource of type #Chassis.v1_16_0.Chassis named foobar was not found.",
"MessageArgs": [
"#Chassis.v1_16_0.Chassis",
"foobar"
],
"MessageId": "Base.1.8.1.ResourceNotFound",
"MessageSeverity": "Critical",
"Resolution": "Provide a valid resource identifier and resubmit the request."
}
],
"code": "Base.1.8.1.ResourceNotFound",
"message": "The requested resource of type #Chassis.v1_16_0.Chassis named foobar was not found."
}

Identically to previously.

Also tested with IDs that contained % encoded characters, like
foobar%10, which gave the same result.

Signed-off-by: Ed Tanous <edtanous@google.com>
Change-Id: Icbb3bce5d190a260610087c9ef35e7becc5a50c7

show more ...


# 15ed6780 14-Dec-2021 Willy Tu <wltu@google.com>

json_utils: Add support jsonRead Patch/Action

Added support for readJson for Patch and Action. The only difference is
that Patch does not allow empty json input while Action does. Action with
empty

json_utils: Add support jsonRead Patch/Action

Added support for readJson for Patch and Action. The only difference is
that Patch does not allow empty json input while Action does. Action with
empty input will use the default value based on the implementation and
return 200 OK response code.

readJsonPatch will replace the existing readJson and be used for path
requests. It will not allow empty json input and all requested
keys are required in the json input.

readJsonAction will be used for Action requests where it is possible for
all of the properties to be optional and allow empty request.
The optional properties are determined by the requested values type.

All current Action readJson are replaced with readJsonAction. It does
not change the existing behavior since it needs `std::optional`.
This will have to be updated later as we define the default behavior.

Tested:
Added unit tests and readJsonAction allows empty empty json object.

No Change to Redfish Tree.

Change-Id: Ia5e1f81695c528a20f1dc985aee19c920d8adaea
Signed-off-by: Willy Tu <wltu@google.com>

show more ...


# e05aec50 25-Jan-2022 Ed Tanous <edtanous@google.com>

Add readability-redundant-* checks

There's a number of redundancies in our code that clang can sanitize
out. Fix the existing problems, and enable the checks.

Signed-off-by: Ed Tanous <edtanous@go

Add readability-redundant-* checks

There's a number of redundancies in our code that clang can sanitize
out. Fix the existing problems, and enable the checks.

Signed-off-by: Ed Tanous <edtanous@google.com>
Change-Id: Ie63d7b7f0777b702fbf1b23a24e1bed7b4f5183b

show more ...


# 9eb808c1 25-Jan-2022 Ed Tanous <edtanous@google.com>

Enable readability-avoid-const-params-in-decls

This check involves explicitly declaring variables const when they're
declared auto, which helps in readability, and makes it more clear that
the varia

Enable readability-avoid-const-params-in-decls

This check involves explicitly declaring variables const when they're
declared auto, which helps in readability, and makes it more clear that
the variables are const.

Signed-off-by: Ed Tanous <edtanous@google.com>
Change-Id: I71198ea03850384a389a56ad26f2c4a48c75b148

show more ...


# 26f6976f 25-Jan-2022 Ed Tanous <edtanous@google.com>

Enable readability-container-size-empty tests

This one is a little trivial, but it does help in readability.

Signed-off-by: Ed Tanous <edtanous@google.com>
Change-Id: I5366d4eec8af2f781b3bad804131a

Enable readability-container-size-empty tests

This one is a little trivial, but it does help in readability.

Signed-off-by: Ed Tanous <edtanous@google.com>
Change-Id: I5366d4eec8af2f781b3bad804131ae2eb806e3aa

show more ...


# 711ac7a9 20-Dec-2021 Ed Tanous <edtanous@google.com>

Consistently use ManagedObjectType

Some subsystems seem to have invented their own typedefs for this stuff,
move to using the one typedef in dbus::utility so we're consistent, and
we reduce our temp

Consistently use ManagedObjectType

Some subsystems seem to have invented their own typedefs for this stuff,
move to using the one typedef in dbus::utility so we're consistent, and
we reduce our templates.

Tested: code compiles

This saves a negligible amount (104 bytes compressed) on our binary
size.

Signed-off-by: Ed Tanous <edtanous@google.com>
Change-Id: I952ea1f960aa703808d0ac80f35dc24cdd8d5027

show more ...


# e1cc4828 01-Dec-2021 Brian Ma <chma0@nuvoton.com>

update_service: fix fwUpdateErrorMatcher cannot working

Because the phosphor logging commit ef952af2 stop emitting the
propChanged signal before ifacesAdded signal raising, the
fwUpdateErrorMatcher

update_service: fix fwUpdateErrorMatcher cannot working

Because the phosphor logging commit ef952af2 stop emitting the
propChanged signal before ifacesAdded signal raising, the
fwUpdateErrorMatcher cannot get any software error after image update.
Update fwUpdateErrorMatcher to get ifacesAdded dbus signal to handle
software error.

Tested:
Post bad manifest image and get "Invalid manifest" error response

Signed-off-by: Brian Ma <chma0@nuvoton.com>
Change-Id: I066e0cec0ddf7569dd73b2601f838c697bac24da

show more ...


# 1e1e598d 11-Jun-2021 Jonathan Doman <jonathan.doman@intel.com>

Using sdbusplus::asio::getProperty

It simplifies a lot of code and after changing sdbusplus implementation
slightly reduces binary size if used together with:

https://gerrit.openbmc-project.xyz/c/o

Using sdbusplus::asio::getProperty

It simplifies a lot of code and after changing sdbusplus implementation
slightly reduces binary size if used together with:

https://gerrit.openbmc-project.xyz/c/openbmc/sdbusplus/+/49467

* Uncompressed size: 3033148 -> 3012164, -20984 B
* gzip compressed size: 1220586 -> 1214625, -5961 B

Tested:
- Redfish validator output is the same before and after the change

Change-Id: Ibe3227d3f4230de2363ba3d9396e51130c8240a5
Signed-off-by: Jonathan Doman <jonathan.doman@intel.com>
Signed-off-by: Krzysztof Grobelny <krzysztof.grobelny@intel.com>

show more ...


# 168e20c1 13-Dec-2021 Ed Tanous <edtanous@google.com>

Move to common variant

This saves approximately 34kB in the compressed binary size of bmcweb
due to reduced template instantiations. This amounts to a 2.5%
reduction in the overall size.

Note, the

Move to common variant

This saves approximately 34kB in the compressed binary size of bmcweb
due to reduced template instantiations. This amounts to a 2.5%
reduction in the overall size.

Note, there were a few places where we broke const-correctness in the
form of pulling a non-const reference out of a const variant. This
new variant now requires const correctness, so some consts are
added where required.

Tested: Code compiles.

Signed-off-by: Ed Tanous <edtanous@google.com>
Change-Id: I6a60c8881c1268627eedb4ffddf16689dc5f6ed2

show more ...


# 0fda0f12 15-Nov-2021 George Liu <liuxiwei@inspur.com>

Update clang-format

refer: https://github.com/openbmc/docs/blob/master/style/cpp/.clang-format
`Don't break long string literals`

Tested: built bmcweb successfully and RedfishValidator Passed.

Sig

Update clang-format

refer: https://github.com/openbmc/docs/blob/master/style/cpp/.clang-format
`Don't break long string literals`

Tested: built bmcweb successfully and RedfishValidator Passed.

Signed-off-by: George Liu <liuxiwei@inspur.com>
Change-Id: Ib58f7c942fd3838592e043c57e0b6ffcdc3d963b

show more ...


# a3e65892 16-Sep-2021 Ed Tanous <edtanous@google.com>

Make fewer copies

There are apparently places where we make complete copies of the request
structure, including the body data within it. Recently,
59b98b2222fddbea3d6f678d9e94006521f0c381 came alon

Make fewer copies

There are apparently places where we make complete copies of the request
structure, including the body data within it. Recently,
59b98b2222fddbea3d6f678d9e94006521f0c381 came along and made the size of
the Request structure include the body payload. This is good for object
ownership, but bad for code that wants to make a copy.

This commit tries to do something less insane, and construct the Payload
object (which only really includes the http headers, uri and method)
before jumping into callback hell, thus meaning that the Payload object
is copied 4 times instead of the Request object.

Tested:
Code compiles. Deleted the boost::beast::http::message copy
constructor, and observed that new code now compiles without needing a
copy.

Signed-off-by: Ed Tanous <edtanous@google.com>
Change-Id: Ie81bade61fb1f6f392b163f98c84540e09a26690

show more ...


# ed398213 09-Jun-2021 Ed Tanous <edtanous@google.com>

Automate PrivilegeRegistry to code

This commit attempts to automate the creation of our privileges
structures from the redfish privilege registry. It accomplishes this by
updating parse_registries.

Automate PrivilegeRegistry to code

This commit attempts to automate the creation of our privileges
structures from the redfish privilege registry. It accomplishes this by
updating parse_registries.py to also pull down the privilege registry
from DMTF.
The script then generates privilege_registry.hpp, which include const
defines for all the privilege registry entries in the same format that
the Privileges struct accepts. This allows new clients to simply
reference the variable to these privilege structures, instead of having
to manually (ie error pronely) put the privileges in themselves.

This commit updates all the routes.

For the moment, override and OEM schemas are not considered. Today we
don't have any OEM-specific Redfish routes, so the existing ones inherit
their parents schema. Overrides have other issues, and are already
incorrect as Redfish defines them.

Binary size remains unchanged after this patchset.

Tested:
Ran redfish service validator

Ran test case from f9a6708c4c6490257e2eb6a8c04458f500902476 to ensure
that the new privileges constructor didn't cause us to regress the brace
construction initializer.

Checked binary size with:
gzip -c
$BBPATH/tmp/work/s7106-openbmc-linux-gnueabi/obmc-phosphor-image/1.0-r0/rootfs/usr/bin/bmcweb
| wc -c
1244048

(tested on previous patchset)

Signed-off-by: Ed Tanous <edtanous@google.com>
Change-Id: Ideede3d5b39d50bffe7fe78a0848bdbc22ac387f

show more ...


# 432a890c 14-Jun-2021 Ed Tanous <edtanous@google.com>

Remove ambiguous privileges constructor

There are a number of endpoints that assume that a given routes
privileges are governed by a single set of privileges, instead of
multiple sets ORed together.

Remove ambiguous privileges constructor

There are a number of endpoints that assume that a given routes
privileges are governed by a single set of privileges, instead of
multiple sets ORed together. To handle this, there were two overloads
of the privileges() method, one that took a vector of Privileges, and
one that took an initializer_list of const char*. Unfortunately, this
leads some code in AccountService to pick the wrong overload when it's
called like this
.privileges( {{"ConfigureUsers"}, {"ConfigureManager"},
{"ConfigureSelf"}})

This is supposed to be "User must have ConfigureUsers, or
ConfigureManager, or ConfigureSelf". Currently, because it selects the
wrong overload, it computes to "User must have ConfigureUsers AND
ConfigureManager AND ConfigureSelf.

The double braces are supposed to cause this to form a vector of
Privileges, but it appears that the initializer list gets consumed, and
the single invocation of initializer list is called. Interestingly,
trying to put in a privileges overload of
intializer_list<initializer_list<const char*>> causes the compilation to
fail with an ambiguous call error, which is what I would've expected to
see previously in this case, but alas, I'm only a novice when it comes
to how the C++ standard works in these edge cases. This is likely due
in part to the fact that they were templates of an unused template param
(seemingly copied from the previous method) and SFINAE rules around
templates.

This commit functionally removes one of the privileges overloads, and
adds a second set of braces to every privileges call that previously had
a single set of braces. Previous code will not compile now, which is
IMO a good thing.

This likely popped up in the Node class removal, because the Node class
explicitly constructs a vector of Privilege objects, ensuing it can hit
the right overload

Tested:
Ran Redfish service validator

Tested the specific use case outlined on discord with:
Creating a new user with operator privilege:
```
redfishtool -S Always -u root -p 0penBmc -vvvvvvvvv -r 192.168.7.2
AccountService adduser foo mysuperPass1 Operator
```

Then attempting to list accounts:
```
curl -vvvv --insecure --user foo:mysuperPass1
https://192.168.7.2/redfish/v1/AccountService/Accounts/foo
```

Which succeeded and returned the account in question.

Signed-off-by: Ed Tanous <edtanous@google.com>
Change-Id: I83e62b70e97f56dc57d43b9081f333a02fe85495

show more ...


# 0588a3b9 10-Jun-2021 Chicago Duan <duanzhijia01@inspur.com>

Redfish: Fix bug that cause validator failed

MaxImageSizeBytes was added in this commit:
https://gerrit.openbmc-project.xyz/c/openbmc/bmcweb/+/43775
but the UpdateService version number was not chan

Redfish: Fix bug that cause validator failed

MaxImageSizeBytes was added in this commit:
https://gerrit.openbmc-project.xyz/c/openbmc/bmcweb/+/43775
but the UpdateService version number was not changed.

MaxImageSizeBytes in UpdateService belongs to UpdateService.v1_5_0.json

https://redfish.dmtf.org/schemas/v1/UpdateService.v1_5_0.json

Tested: Validator passes

Signed-off-by: Chicago Duan <duanzhijia01@inspur.com>
Change-Id: I68f01ce5fb8f8e715c0e0fad6a34ab609acca01b

show more ...


# d61e5194 04-Jun-2021 Tejas Patil <tejaspp@ami.com>

Add support for MaxImageSizeBytes in UpdateService

This commit adds the support for "MaxImageSizeBytes" property
in the "/redfish/v1/UpdateService/" Redfish URI.

This property indicates that, the m

Add support for MaxImageSizeBytes in UpdateService

This commit adds the support for "MaxImageSizeBytes" property
in the "/redfish/v1/UpdateService/" Redfish URI.

This property indicates that, the maximum size of the
software update image, that clients can send to this Update Service.

Tested:

- Redfish Validator Test passed.

curl -k -H "X-Auth-Token: $token" -H "Content-Type: application/json" -X GET https://${bmc}/redfish/v1/UpdateService
{
"@odata.id": "/redfish/v1/UpdateService",
"@odata.type": "#UpdateService.v1_4_0.UpdateService",
"Description": "Service for Software Update",
"FirmwareInventory": {
"@odata.id": "/redfish/v1/UpdateService/FirmwareInventory"
},
"HttpPushUri": "/redfish/v1/UpdateService",
"HttpPushUriOptions": {
"HttpPushUriApplyTime": {
"ApplyTime": "OnReset"
}
},
"Id": "UpdateService",
"MaxImageSizeBytes": 31457280,
"Name": "Update Service",
"ServiceEnabled": true
}

Signed-off-by: Tejas Patil <tejaspp@ami.com>
Change-Id: Ibc0f3094a50ea7eb274436e4359e05c95d9cec36

show more ...


# 7e860f15 08-Apr-2021 John Edward Broadbent <jebr@google.com>

Remove Redfish Node class

Reduces the total number of lines and will allow for easier testing of
the redfish responses.

A main purpose of the node class was to set app.routeDynamic(). However
now a

Remove Redfish Node class

Reduces the total number of lines and will allow for easier testing of
the redfish responses.

A main purpose of the node class was to set app.routeDynamic(). However
now app.routeDynamic can handle the complexity that was once in critical
to node. The macro app.routeDynamic() provides a shorter cleaner
interface to the unerlying app.routeDyanic call. The old pattern set
permissions for 6 interfaces (get, head, patch, put, delete_, and post)
even if only one interface is created. That pattern creates unneeded
code that can be safely removed with no effect.
Unit test for the responses would have to mock the node the class in
order to fully test responses.

see https://github.com/openbmc/bmcweb/issues/181

The following files still need node to be extracted.

virtual_media.hpp
account_service.hpp
redfish_sessions.hpp
ethernet.hpp

The files above use a pattern that is not trivial to address. Often their
responses call an async lambda capturing the inherited class. ie
(https://github.com/openbmc/bmcweb/blob/ffed87b5ad1797ca966d030e7f979770
28d258fa/redfish-core/lib/account_service.hpp#L1393)
At a later point I plan to remove node from the files above.

Tested:
I ran the docker unit test with the following command.
WORKSPACE=$(pwd) UNIT_TEST_PKG=bmcweb
./openbmc-build-scripts/run-unit-test-docker.sh

I ran the validator and this change did not create any issues.
python3 RedfishServiceValidator.py -c config.ini

Signed-off-by: John Edward Broadbent <jebr@google.com>
Signed-off-by: Ed Tanous <edtanous@google.com>
Change-Id: I147a0289c52cb4198345b1ad9bfe6fdddf57f3df

show more ...


# 5af690f5 25-May-2021 Abhishek Patel <Abhishek.Patel@ibm.com>

Adjust parameter name of FirmwareInventoryId

redfish URL "/redfish/v1/UpdateService/FirmwareInventory/
{SoftwareInventoryId}" had parameter called "Members@odata.count".

This parameter name is not

Adjust parameter name of FirmwareInventoryId

redfish URL "/redfish/v1/UpdateService/FirmwareInventory/
{SoftwareInventoryId}" had parameter called "Members@odata.count".

This parameter name is not appropriate because it retrieves data, count
of Related Item, from "RelatedItem" parameter, so its name has to be
"RelatedItem@odata.count".

Implement:
Updated name of JSON parameter, also updated code variable name.

Tested: Validator passes

- Keep primary data and other parameter deleted from JSON data
Old JSON data:
{
"@odata.id": "/redfish/v1/UpdateService/FirmwareInventory/
{SoftwareInventoryId},
"@odata.type": "#SoftwareInventory.v1_1_0.SoftwareInventory",
"Description": "BMC image",
"Members@odata.count": 1,
"Name": "Software Inventory",
"RelatedItem": [{
"@odata.id": "/redfish/v1/Managers/bmc"
}],
}
new JSON data:
{
"@odata.id": "/redfish/v1/UpdateService/FirmwareInventory/
{SoftwareInventoryId},
"@odata.type": "#SoftwareInventory.v1_1_0.SoftwareInventory",
"Description": "BMC image",
"RelatedItem@odata.count": 1,
"Name": "Software Inventory",
"RelatedItem": [{
"@odata.id": "/redfish/v1/Managers/bmc"
}],
}

Signed-off-by: Abhishek Patel <Abhishek.Patel@ibm.com>
Change-Id: I12c123fc78872890efe2949d2a3a55f882cdd09b

show more ...


# 8d1b46d7 31-Mar-2021 zhanghch05 <zhanghch05@inspur.com>

Using AsyncResp everywhere

Get the core using AsyncResp everywhere, and not have each individual handler
creating its own object.We can call app.handle() without fear of the response
getting ended a

Using AsyncResp everywhere

Get the core using AsyncResp everywhere, and not have each individual handler
creating its own object.We can call app.handle() without fear of the response
getting ended after the first tree is done populating.
Don't use res.end() anymore.

Tested:
1. Validator passed.

Signed-off-by: zhanghaicheng <zhanghch05@inspur.com>
Change-Id: I867367ce4a0caf8c4b3f4e07e06c11feed0782e8

show more ...


# 2dfd18ef 17-Dec-2020 Ed Tanous <ed@tanous.net>

Start using sdbusplus::message::filename()

Lots of code gets checked in that does this path checking incorrectly.
So much so, that we have it documented in COMMON_ERRORS.md, yet, we
persist. This p

Start using sdbusplus::message::filename()

Lots of code gets checked in that does this path checking incorrectly.
So much so, that we have it documented in COMMON_ERRORS.md, yet, we
persist. This patchset starts using the new object_path::filename()
method that was added recently to sdbusplus. Overall, it deletes code,
and makes for a much better developer experience.

Tested:
Pulled down several endpoints and verified that filename() method works
properly, and the collections are returned as expected.

curl -vvvv --insecure --user root:0penBmc https://192.168.7.2/redfish/v1/AccountService/Accounts

Signed-off-by: Ed Tanous <edtanous@google.com>
Change-Id: Ief1e0584394fb139678d3453265f7011bc931f3c

show more ...


# d7a596bd 20-Jan-2021 Albert Zhang <zhanghaodi@inspur.com>

Tasks for TFTP upload

This is to change the existing TFTP update into an asynchronous service
that uses Redfish Tasks.

Tested:

TFTP Firmware update through redfish,and get the task to create.

Tasks for TFTP upload

This is to change the existing TFTP update into an asynchronous service
that uses Redfish Tasks.

Tested:

TFTP Firmware update through redfish,and get the task to create.

curl -k -H "X-Auth-Token: $token" -X POST
https://${bmc}/redfish/v1/UpdateService/Actions/UpdateService.SimpleUpdate
-d '{"TransferProtocol":"TFTP","ImageURI":"xx.xx.xx.xx/obmc-phosphor-xxxxx"}'
{
"@odata.id": "/redfish/v1/TaskService/Tasks/0",
"@odata.type": "#Task.v1_4_3.Task",
"Id": "0",
"TaskState": "Running",
"TaskStatus": "OK"
}

Signed-off-by: Albert Zhang <zhanghaodi@inspur.com>
Change-Id: I5d8683f38bf3e29177d90606c5c9fe747a26a876

show more ...


# 6868ff50 01-Jan-2021 George Liu <liuxiwei@inspur.com>

Implement PercentComplete for code update

In order to implement full task support for code update,
the PercentComplete property is added to the task service.

Testd: Validator passes.
curl -k -H "X-

Implement PercentComplete for code update

In order to implement full task support for code update,
the PercentComplete property is added to the task service.

Testd: Validator passes.
curl -k -H "X-Auth-Token: $token" -X GET https://${bmc}/redfish/v1/TaskService/Tasks/0
{
"@odata.id": "/redfish/v1/TaskService/Tasks/0",
"@odata.type": "#Task.v1_4_3.Task",
... ...
"PercentComplete": 100,
"TaskMonitor": "/redfish/v1/TaskService/Tasks/0/Monitor",
"TaskState": "Completed",
"TaskStatus": "OK"
}

Signed-off-by: George Liu <liuxiwei@inspur.com>
Change-Id: I030bf0bbff098dec2f45158642f149711554285d

show more ...


# 88b3dd12 20-Nov-2020 Gunnar Mills <gmills@us.ibm.com>

Look for Version Already Exists Error

Look for Software.Version.Error.AlreadyExists and return Invalid Upload
and Resource Already Exists.

Heard from users it is hard to know why the image failed t

Look for Version Already Exists Error

Look for Software.Version.Error.AlreadyExists and return Invalid Upload
and Resource Already Exists.

Heard from users it is hard to know why the image failed to upload
in this case.

Tested: Built with PDI and phosphor-bmc-code-mgmt changes and saw the
error.

curl -k -H "Content-Type: application/octet-stream" -X POST -T $image https://${bmc}/redfish/v1/UpdateService
{
"Version@Message.ExtendedInfo": [
{
"@odata.type": "#Message.v1_1_1.Message",
"Message": "The requested resource of type UpdateService.v1_4_0.UpdateService with the property Version with the value uploaded version already exists.",
"MessageArgs": [
"UpdateService.v1_4_0.UpdateService",
"Version",
"uploaded version"
],
"MessageId": "Base.1.8.1.ResourceAlreadyExists",
"MessageSeverity": "Critical",
"Resolution": "Do not repeat the create operation as the resource has already been created."
}
],
"error": {
"@Message.ExtendedInfo": [
{
"@odata.type": "/redfish/v1/$metadata#Message.v1_1_1.Message",
"Message": "Invalid file uploaded to /redfish/v1/UpdateService: Image version already exists.",
"MessageArgs": [
"/redfish/v1/UpdateService",
"Image version already exists"
],
"MessageId": "OpenBMC.0.1.0.InvalidUpload",
"MessageSeverity": "Warning",
"Resolution": "None."
}
],
"code": "OpenBMC.0.1.0.InvalidUpload",
"message": "Invalid file uploaded to /redfish/v1/UpdateService: Image version already exists."
}
}
Change-Id: Ieab0116650dd64949da6b7ac93254193803f8f90
Signed-off-by: Gunnar Mills <gmills@us.ibm.com>

show more ...


# 81ce609e 17-Dec-2020 Ed Tanous <ed@tanous.net>

Fix .clang-tidy

camelLower is not a type, camelBack is.

Changes were made automatically with clang-tidy --fix-errors

To be able to apply changes automatically, the only way I've found that
works w

Fix .clang-tidy

camelLower is not a type, camelBack is.

Changes were made automatically with clang-tidy --fix-errors

To be able to apply changes automatically, the only way I've found that
works was to build the version of clang/clang-tidy that yocto has, and
run the fix script within bitbake -c devshell bmcweb. Unfortunately,
yocto has clang-tidy 11, which can apparently find a couple extra errors
in tests we already had enabled. As such, a couple of those are also
included.

Tested:
Ran clang-tidy-11 and got a clean result.

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

show more ...


1234567