DMTF / Redfish-URI-Validator

The Redfish URI Validator is a Python3 tool which scans all resources on a given service and verifies the URIs on the service match the patterns described in a provided OpenAPI specification.
Other
1 stars 2 forks source link

YAMLLoadWarning and login hang issue #3

Closed snk20501 closed 5 years ago

snk20501 commented 5 years ago

Hi,

When I run the tool under Windows with python 3.7, I see below problem and tool hangs at "Logging" step. Also I see YAMLLoadWarning message.

Command: D:\scripts\Redfish-URI-Validator-master>python redfish-uri-validator.py --user Administrator --password superuser --rhost https://172.31.100.212:443 --openapi D:\scripts\Redfish-URI-Validator-master\openapi\openapi.yaml

response `Opening D:\scripts\Redfish-URI-Validator-master\openapi\openapi.yaml... redfish-uri-validator.py:46: YAMLLoadWarning: calling yaml.load() without Loader=... is deprecated, as the default Loader is unsafe. Please read https://msg.pyyaml.org/load for full details. openapi_data = yaml.load( openapi_file ) Config file 'C:\Users\CaffreyLai\AppData\Local\Programs\Python\Python37\redfish.conf' not found

Logging in to https://172.31.100.212:443...`

Please help to check.

billdodd commented 5 years ago

I ran the tool against a system and did not see any hang. Though I am using Python 3.6 on a non-Windows system.

First, a comment:

Now some questions and things to try:

  1. After the "Logging in to ..." message, the tool starts scanning all the resources on the service. This may take a long time. How long are you waiting? If you leave it running (for example overnight), does it eventually complete? In most case cases, I would only expect it to take several minutes at most. But depending on the number of resources on the service and how fast it responds, it could take much longer.
  2. You mention that you are running on Windows with Python 3.7. If you are able, can you see if the hang also occurs on Python 3.6 with Windows? How about on a non-Windows system?
snk20501 commented 5 years ago

Hi Bill,

Thank you so much for providing details. Please see reply for your questions.

For Question_1. , This is the reason I thought the tool hang because our product has more than 400 URI resources. If can add some print info for scanning process, that will be very helpful.

For Question_2. , Actually, the tool can complete the test in the end.

Thanks, BR, Caffrey

billdodd commented 5 years ago

@snk20501 - Glad to hear it is working. I agree that a verbose or debug option to show progress while it is running would be helpful here.

jautor commented 5 years ago

Discussion 8/29 - will add a verbose/debug option to create some output allowing debug in these situations...

snk20501 commented 5 years ago

Thanks for the support.

billdodd commented 5 years ago

In researching this a bit more, the heavy lifting of reading in all the service resources is done by the python-redfish-library package. So and verbose output would have to be generated there. There is a verbose param that can be passed in to the RmcApp.login() method. But doing so only emits a single line of output showing the total time taken to read the resources (which is not helpful for this scenario).

There is also the python logging capability in python-redfish-library that can be enabled/configured. But currently, it is set up to only allow specifying the name of a disk file to log to. For this issue, we would want to have it log to stdout. That is easy enough to do but will need a change in python-redfish-library.

I'm wondering now if the problem could be solved more simply by just updating the URI-Validator status lines that are currently being printed to add something along the lines of "this may take a while..." at the appropriate point?

Thoughts?

jautor commented 5 years ago

Discussion 9/5: Let's add the simple message explaining that the process may take some time and see if that provides enough feedback before diving into the library to make changes.