Skip to content

Commit

Permalink
Added sanity checks for OEM link logic
Browse files Browse the repository at this point in the history
Signed-off-by: Tomas <[email protected]>
  • Loading branch information
tomasg2012 committed Mar 8, 2024
1 parent 7ec778e commit a70e9db
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions redfish_service_validator/validateResource.py
Original file line number Diff line number Diff line change
Expand Up @@ -362,13 +362,13 @@ def validateURITree(service, URI, uriName, expectedType=None, expectedJson=None,
continue
link_destination = link.Value.get('@odata.id', link.Value.get('Uri'))

if link.IsExcerpt or link.Type.Excerpt:
continue
if not service.config['oemcheck']:
if '/Oem/' in link_destination or 'Resource.OemObject' in link.Type.getTypeTree():
if link_destination and '/Oem/' in link_destination or link and 'Resource.OemObject' in link.Type.getTypeTree():
my_logger.info('Oem link skipped: {}'.format(link_destination))
counts['skipOemLink'] += 1
continue
if link.IsExcerpt or link.Type.Excerpt:
continue
if any(x in str(link.parent.Type) or x in link.Name for x in ['RelatedItem', 'Redundancy', 'Links', 'OriginOfCondition']) and not link.IsAutoExpanded:
referenced_links.append((link, thisobj))
continue
Expand Down

0 comments on commit a70e9db

Please sign in to comment.