DMTF / Redfishtool

A Python34 program that implements a command line tool for accessing the Redfish API.
Other
224 stars 68 forks source link

Show collection members even if optional prop not present #78

Closed billdodd closed 4 years ago

billdodd commented 4 years ago

For some reason, in listCollection(), the collection members are not added to the returned member list if the specified prop (e.g. AssetTag) is not present in the member resource.

Fixed the code so that all the members are displayed. If the prop is present, it is shown in the output.

Before fix:

AssetTag present:

{
    "_Path": "/redfish/v1/Systems",
    "Name": "Computer System Collection",
    "Members@odata.count": 1,
    "Members": [
        {
            "Id": "437XR1138R2",
            "@odata.id": "/redfish/v1/Systems/437XR1138R2",
            "AssetTag": "Chicago-45Z-2381"
        }
    ]
}

AssetTag not present:

{
    "_Path": "/redfish/v1/Systems",
    "Name": "Computer System Collection",
    "Members@odata.count": 1,
    "Members": []
}

After fix:

AssetTag present:

{
    "_Path": "/redfish/v1/Systems",
    "Name": "Computer System Collection",
    "Members@odata.count": 1,
    "Members": [
        {
            "Id": "437XR1138R2",
            "@odata.id": "/redfish/v1/Systems/437XR1138R2",
            "AssetTag": "Chicago-45Z-2381"
        }
    ]
}

AssetTag not present:

{
    "_Path": "/redfish/v1/Systems",
    "Name": "Computer System Collection",
    "Members@odata.count": 1,
    "Members": [
        {
            "Id": "437XR1138R2",
            "@odata.id": "/redfish/v1/Systems/437XR1138R2"
        }
    ]
}

Fixes #76

mraineri commented 4 years ago

Approved 4/9