diff --git a/common/catalog.py b/common/catalog.py index fa70fd0..9baee5c 100644 --- a/common/catalog.py +++ b/common/catalog.py @@ -125,6 +125,8 @@ def getSchemaDocByClass(self, typename): :return: Schema Document :rtype: SchemaDoc """ + if 'Collection(' in typename: + typename = typename.replace('Collection(', "").replace(')', "") typename = getNamespaceUnversioned(typename) typename = self.alias.get(typename, typename) if typename in self.catalog_by_class: @@ -960,10 +962,6 @@ def populate(self, payload, check=False, casted=False): rsc_type, rsc_value, odata_value = rsc my_str = re.sub('\{|Id\}|', '', section) sub_obj.HasValidUriStrict = sub_obj.HasValidUriStrict and rsc_type == my_str and rsc_value == odata_value - if rsc_type != my_str: - my_logger.warning('Resource tree in URI {} has incorrect typing: {} {}'.format(my_odata_id, rsc_type, my_str)) - if rsc_value != odata_value: - my_logger.warning('Resource tree in URI {} has incorrect ID: {} {}'.format(my_odata_id, rsc_value, odata_value)) if sub_obj.HasValidUriStrict: break diff --git a/validateRedfish.py b/validateRedfish.py index 2d4fee1..f79c952 100644 --- a/validateRedfish.py +++ b/validateRedfish.py @@ -94,6 +94,9 @@ def validateEntity(service, prop, val, parentURI=""): my_logger.debug('validateEntity: name = {}'.format(name)) # check for required @odata.id + if not isinstance(val, dict): + my_logger.info("{}: EntityType val is null/absent, not testing...".format(name)) + return False uri = val.get('@odata.id') if '@odata.id' not in val: if autoExpand: uri = parentURI + '#/{}'.format(name.replace('[', '/').strip(']'))