DMTF/Redfish-Profile-Simulator

Problems with /redfish/v1/$metadata

billdodd opened this issue · 0 comments

While investigating DMTF/Redfish-Service-Validator#234 I found a few of issues with the handling of /redfish/v1/$metadata in the simulator.

  1. Doing a GET on /redfish/v1/$metadata results in a failure with this exception callstack:
[2018-05-24 11:12:51,896] ERROR in app: Exception on /redfish/v1/$metadata/ [GET]
Traceback (most recent call last):
  File "/usr/local/lib/python3.6/site-packages/flask/app.py", line 1974, in make_response
    rv = self.response_class.force_type(rv, request.environ)
  File "/usr/local/lib/python3.6/site-packages/werkzeug/wrappers.py", line 921, in force_type
    response = BaseResponse(*_run_wsgi_app(response, environ))
  File "/usr/local/lib/python3.6/site-packages/werkzeug/test.py", line 923, in run_wsgi_app
    app_rv = app(environ, start_response)
TypeError: 'RfOdataMetadata' object is not callable

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/usr/local/lib/python3.6/site-packages/flask/app.py", line 2292, in wsgi_app
    response = self.full_dispatch_request()
  File "/usr/local/lib/python3.6/site-packages/flask/app.py", line 1816, in full_dispatch_request
    return self.finalize_request(rv)
  File "/usr/local/lib/python3.6/site-packages/flask/app.py", line 1831, in finalize_request
    response = self.make_response(rv)
  File "/usr/local/lib/python3.6/site-packages/flask/app.py", line 1982, in make_response
    reraise(TypeError, new_error, sys.exc_info()[2])
  File "/usr/local/lib/python3.6/site-packages/flask/_compat.py", line 34, in reraise
    raise value.with_traceback(tb)
  File "/usr/local/lib/python3.6/site-packages/flask/app.py", line 1974, in make_response
    rv = self.response_class.force_type(rv, request.environ)
  File "/usr/local/lib/python3.6/site-packages/werkzeug/wrappers.py", line 921, in force_type
    response = BaseResponse(*_run_wsgi_app(response, environ))
  File "/usr/local/lib/python3.6/site-packages/werkzeug/test.py", line 923, in run_wsgi_app
    app_rv = app(environ, start_response)
TypeError: 'RfOdataMetadata' object is not callable
The view function did not return a valid response. The return type must be a string, tuple, Response instance, or WSGI callable, but it was a RfOdataMetadata.
127.0.0.1 - - [24/May/2018 11:12:51] "GET /redfish/v1/%24metadata/ HTTP/1.1" 500 -
  1. After correcting that problem, the $metadata is returned, but with a Content-Type header of text/html instead of application/xml.

  2. Also, the simulator is requiring authentication for the $metadata URI access. It should not.