Skip to content
Commit 8be2b5b6 authored by Potin Lai's avatar Potin Lai Committed by Ed Tanous
Browse files

managers: fix interface patch and delete of pid object



Only set createNewObject to true when corresponding interface not found
in the object.

Tested on Bletchley:

- Add new StepwiseController called SWTest
Body in JSON format
```
{
    "Oem": {
        "OpenBmc": {
            "Fan": {
                "StepwiseControllers": {
                    "SWTest": {
                        "Direction": "Floor",
                        "Inputs": [
                            "MB_U402_THERM_LOCAL"
                        ],
                        "NegativeHysteresis": 1.0,
                        "PositiveHysteresis": 2.0,
                        "Steps": [
                            {
                                "Output": 0.0,
                                "Target": 48.0
                            },
                            {
                                "Output": 15.0,
                                "Target": 49.0
                            }
                        ],
                        "Zones": [
                            {
                                "@odata.id": "/redfish/v1/Managers/bmc#/Oem/OpenBmc/Fan/FanZones/Zone0"
                            }
                        ]
                    }
                }
            }
        }
    }
}
```
Checking object from dbus
```
root@bletchley:~# busctl introspect xyz.openbmc_project.EntityManager \
> /xyz/openbmc_project/inventory/system/chassis/Bletchley_Chassis/SWTest \
> xyz.openbmc_project.Configuration.Stepwise
NAME                                       TYPE      SIGNATURE RESULT/VALUE            FLAGS
.Delete                                    method    -         -                       -
.Class                                     property  s         "Floor"                 emits-change writable
.Inputs                                    property  as        1 "MB U402 THERM LOCAL" emits-change writable
.Name                                      property  s         "SWTest"                emits-change writable
.NegativeHysteresis                        property  d         1                       emits-change writable
.Output                                    property  ad        2 0 15                  emits-change writable
.PositiveHysteresis                        property  d         2                       emits-change writable
.Reading                                   property  ad        2 48 49                 emits-change writable
.Type                                      property  s         "Stepwise"              emits-change writable
.Zones                                     property  as        1 "Zone0"               emits-change writable
```

- Patch SWTest properties
Body in JSON format
```
{
    "Oem": {
        "OpenBmc": {
            "Fan": {
                "StepwiseControllers": {
                    "SWTest": {
                        "NegativeHysteresis": 3.0,
                        "PositiveHysteresis": 4.0
                    }
                }
            }
        }
    }
}
```
Checking object from dbus
```
root@bletchley:~# busctl introspect xyz.openbmc_project.EntityManager \
> /xyz/openbmc_project/inventory/system/chassis/Bletchley_Chassis/SWTest \
> xyz.openbmc_project.Configuration.Stepwise
NAME                                       TYPE      SIGNATURE RESULT/VALUE            FLAGS
.Delete                                    method    -         -                       -
.Class                                     property  s         "Floor"                 emits-change writable
.Inputs                                    property  as        1 "MB U402 THERM LOCAL" emits-change writable
.Name                                      property  s         "SWTest"                emits-change writable
.NegativeHysteresis                        property  d         3                       emits-change writable
.Output                                    property  ad        2 0 15                  emits-change writable
.PositiveHysteresis                        property  d         4                       emits-change writable
.Reading                                   property  ad        2 48 49                 emits-change writable
.Type                                      property  s         "Stepwise"              emits-change writable
.Zones                                     property  as        1 "Zone0"               emits-change writable
```

- Delete SWTest object
Body in JSON format
```
{
    "Oem": {
        "OpenBmc": {
            "Fan": {
                "StepwiseControllers": {
                    "SWTest": null
                }
            }
        }
    }
}
```
Object deleted from dbus
```
root@bletchley:~# busctl introspect xyz.openbmc_project.EntityManager \
> /xyz/openbmc_project/inventory/system/chassis/Bletchley_Chassis/SWTest \
> xyz.openbmc_project.Configuration.Stepwise
Failed to introspect object /xyz/openbmc_project/inventory/system/chassis/Bletchley_Chassis/SWTest of service xyz.openbmc_project.EntityManager: Unknown object '/xyz/openbmc_project/inventory/system/chassis/Bletchley_Chassis/SWTest'.
```

Signed-off-by: default avatarPotin Lai <potin.lai@quantatw.com>
Change-Id: I482e942ee3c76dca17af522765d8b3aa9dc8678b
parent 043360d0
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment