Skip to content

Commit

Permalink
Merge pull request #506 from DMTF/Various-Hardening
Browse files Browse the repository at this point in the history
Added check to ensure an action is shown in the response as an object before trying to discover if it has action info
  • Loading branch information
mraineri authored Jul 15, 2022
2 parents 3977679 + c014c2f commit e6748c5
Showing 1 changed file with 6 additions and 5 deletions.
11 changes: 6 additions & 5 deletions common/catalog.py
Original file line number Diff line number Diff line change
Expand Up @@ -1055,11 +1055,12 @@ def getLinks(self):
if n == 'Actions':
new_type = item.Type.catalog.getTypeInCatalog('ActionInfo.ActionInfo')
for act in item.Value.values():
uri = act.get('@Redfish.ActionInfo')
if isinstance(uri, str):
my_link = RedfishObject(new_type, 'ActionInfo', item).populate({'@odata.id': uri})
my_link.InAnnotation = True
links.append(my_link)
if isinstance(act, dict):
uri = act.get('@Redfish.ActionInfo')
if isinstance(uri, str):
my_link = RedfishObject(new_type, 'ActionInfo', item).populate({'@odata.id': uri})
my_link.InAnnotation = True
links.append(my_link)
if item.Type.IsNav:
if isinstance(item.Value, list):
for num, val in enumerate(item.Value):
Expand Down

0 comments on commit e6748c5

Please sign in to comment.