1110: Fix TOD battery ReadyToRemove value#1422
Open
baemyung wants to merge 1 commit intoibm-openbmc:1110from
Open
1110: Fix TOD battery ReadyToRemove value#1422baemyung wants to merge 1 commit intoibm-openbmc:1110from
baemyung wants to merge 1 commit intoibm-openbmc:1110from
Conversation
3bc7915 to
17c1285
Compare
Even after PATCH ReadyToRemove of TOD battery to true, its ReadyToRemove
value is not changed. It is because dbus GetObject of ObjectManager does
not return an error even if the target service is stopped.
However, if target service is topped, GetObject does not give the output
of xyz.openbmc_project.State.Decorator.OperationalStatus like
```
dbus-send --system --print-reply --dest=xyz.openbmc_project.ObjectMapper \
/xyz/openbmc_project/object_mapper xyz.openbmc_project.ObjectMapper.GetObject \
string:"/xyz/openbmc_project/sensors/voltage/Battery_Voltage" array:string:
method return time=1774197768.094032 sender=:1.47 -> destination=:1.2058 serial=36472 reply_serial=2
array [
dict entry(
string "xyz.openbmc_project.ObjectMapper"
array [
]
)
```
So, the fix is to check the the existence of the interface.
1. GET TOD Battery
```
curl -k -X GET https://${bmc}/redfish/v1/Chassis/chassis/Assembly
"Name": "Time-of-day battery",
"Oem": {
"OpenBMC": {
"@odata.type": "#OpenBMCAssembly.v1_0_0.OpenBMC",
"ReadyToRemove": false
}
},
```
2. PATCH ReadyToRemove to true
```
curl -H "Content-Type:application/json" -k -X PATCH https://${bmc}/redfish/v1/Chassis/chassis/Assembly -d '{"Assemblies":[{"MemberId":"3","Oem":{"OpenBMC":{"ReadyToRemove":true}}}]}'
```
3. GET TOD Battery
```
"Name": "Time-of-day battery",
"Oem": {
"OpenBMC": {
"@odata.type": "#OpenBMCAssembly.v1_0_0.OpenBMC",
"ReadyToRemove": false
}
},
```
Tested:
- With the fix, after PATCH, ReadyToRemove will become `true`.
Signed-off-by: Myung Bae <myungbae@us.ibm.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Even after PATCH ReadyToRemove of TOD battery to true, its ReadyToRemove value is not changed. It is because dbus GetObject of ObjectManager does not return an error even if the target service is stopped.
Tested:
true.