Closed veedu closed 7 years ago
Hi @veedu
Thanks for opening your issue here in the github repo. In order to help us understand what is causing the problem you are seeing, we would like to request the following additional actions and info:
pip show beautifulsoup4
)python --version
or python3 --version
)To answer your question about the directory structure for files for the mockup server: The directory structure within the directory you specify to the mockup server (for example my_mockup
directory) should look something like this:
$ tree my_mockup/
my_mockup/
└── redfish
├── index.json
└── v1
├── $metadata
│ └── index.xml
├── Chassis
│ ├── System.Embedded.1
│ │ ├── Power
│ │ │ └── index.json
│ │ ├── Thermal
│ │ │ └── index.json
│ │ └── index.json
│ └── index.json
...
├── Systems
│ ├── System.Embedded.1
...
│ └── index.json
├── TaskService
│ ├── Tasks
│ │ └── index.json
│ └── index.json
├── index.json
└── odata
└── index.json
Redfish-Service-Validator-master.zip
Hi Bill,
Thanks for the response. beautifulsoup latest version is 4.6.0, I have modified the traverseService.py for expectedVersion as '4.6.0'. I have installed latest version of validator and still getting the following exception:
[root@aspenvail01 Redfish-Service-Validator-master]# python3 RedfishServiceValidator.py --ip 127.0.0.1:8000 -u root --nochkcert --nossl --service System Info: No desc RedfishServiceValidator Config details: ('http://127.0.0.1:8000', 'user:root', './SchemaFiles/metadata', 'no CheckCert', 'localOnly or service') Start time: 08/16/17 - 12:38:16
*** ServiceRoot, /redfish/v1
Traceback (most recent call last): File "RedfishServiceValidator.py", line 547, in validateSingleURI uriName, URI, expectedType, expectedSchema, expectedJson, parent) File "/home/vidhyag/newval/Redfish-Service-Validator-master/traverseService.py", line 496, in init fullType, SchemaURI=self.context) File "/usr/lib64/python3.4/functools.py", line 472, in wrapper result = user_function(*args, **kwds) File "/home/vidhyag/newval/Redfish-Service-Validator-master/traverseService.py", line 286, in getSchemaDetails soup = BeautifulSoup(data, "html.parser") File "/usr/lib/python3.4/site-packages/bs4/init.py", line 225, in init markup, from_encoding, exclude_encodings=exclude_encodings)): File "/usr/lib/python3.4/site-packages/bs4/builder/_htmlparser.py", line 205, in prepare_markup exclude_encodings=exclude_encodings) File "/usr/lib/python3.4/site-packages/bs4/dammit.py", line 352, in init markup, override_encodings, is_html, exclude_encodings) File "/usr/lib/python3.4/site-packages/bs4/dammit.py", line 228, in init self.markup, self.sniffed_encoding = self.strip_byte_order_mark(markup) File "/usr/lib/python3.4/site-packages/bs4/dammit.py", line 280, in strip_byte_order_mark if (len(data) >= 4) and (data[:2] == b'\xfe\xff') \ TypeError: unhashable type: 'slice' Elapsed time: 0:00:00 1 1 exceptionResource errors in /redfish/v1 Counter({'exceptionResource': 1}) Validation has failed: 1 problems found
[root@aspenvail01 newval]# pip show beautifulsoup4 Name: beautifulsoup4 Version: 4.6.0 Summary: Screen-scraping library Home-page: http://www.crummy.com/software/BeautifulSoup/bs4/ Author: Leonard Richardson Author-email: leonardr@segfault.org License: MIT Location: /usr/lib/python3.4/site-packages Requires:
[root@aspenvail01 newval]# python3 --version Python 3.4.5
I have the directory structure for mockup server the same way as you have mentioned. Herewith, I have attached the Redfish validator folder.
Thanks, Vidhya G
Hi Vidhya,
Thanks for the update. The check for bs4 version 4.5.3 and under in the code is intentional because there is a known problem that the validator tool does not work with bs4 4.6.0. If you uninstall bs4 4.6.0 and install bs4 4.5.3, you should get better results.
Let us know how that goes.
Bill
Closing; issue should be addressed by using the right version of beautifulsoup.
If the issue still persists, please file a new issue.
Hi, Sorry for the delay. The issue is resolved with bs4. Thanks for the quick reply and fix. Regards, Vidhya G
I am getting the following exception thrown while running Redfish validator:
schema alias #ServiceRoot.v1_0_2.ServiceRoot schemauri /redfish/v1/$metadata#ServiceRoot.ServiceRoot config uri %s http://127.0.0.1:8000 refs [] ref link uri n frag /redfish/v1/$metadata ServiceRoot.ServiceRoot SchemaURI missing reference link: /redfish/v1/$metadata ServiceRoot.ServiceRoot xml %s $metadata schema location %s ./SchemaFiles/metadata schema uri %s /redfish/v1/$metadata schema alias $metadata schema alias $metadata schemauri /redfish/v1/$metadata config uri %s http://127.0.0.1:8000 refs [] schema alias None refs [] schema namespace ServiceRoot.v1_0_2 Got XML, but schema still doesn't exist...? ServiceRoot.v1_0_2, #ServiceRoot.v1_0_2.ServiceRoot Something went wrong Traceback (most recent call last): File "/home/vidhyag/Redfish-Service-Validator-master/traverseService.py", line 506, in init baseSoup, baseRefs, baseType, self.tagType, topVersion) File "/home/vidhyag/Redfish-Service-Validator-master/traverseService.py", line 549, in getTypeDetails str(refs.get(getNamespace(SchemaAlias), (getNamespace(SchemaAlias), None)))) Exception: exceptionType: Was not able to get type, is Schema in XML? ('ServiceRoot.v1_0_2', None) : Getting type failed for #ServiceRoot.v1_0_2.ServiceRoot #ServiceRoot.v1_0_2.ServiceRoot SchemaServiceURI /redfish/v1/$metadata
I have verified the contents of $metadata and it seems to be fine. Can you please elaborate on what should the directory structure to place the .xml and $metadata file as we get error with Redfish mockup server too? What should be the content of $metadata and ServiceRoot?