mirror of
https://github.com/ceph/ceph
synced 2025-01-19 17:41:39 +00:00
Merge pull request #24947 from votdev/bug_36708
mgr/dashboard: tasks.mgr.dashboard.test_osd.OsdTest failures Reviewed-by: Laura Paduano <lpaduano@suse.com> Reviewed-by: Patrick Nawracay <pnawracay@suse.com> Reviewed-by: Sebastian Wagner <swagner@suse.com>
This commit is contained in:
commit
9a0a06592a
@ -162,10 +162,8 @@ class DashboardTestCase(MgrTestCase):
|
||||
@classmethod
|
||||
def _request(cls, url, method, data=None, params=None):
|
||||
url = "{}{}".format(cls._base_uri, url)
|
||||
log.info("request %s to %s", method, url)
|
||||
headers = {
|
||||
'Content-Type': 'application/json'
|
||||
}
|
||||
log.info("Request %s to %s", method, url)
|
||||
headers = {}
|
||||
if cls._token:
|
||||
headers['Authorization'] = "Bearer {}".format(cls._token)
|
||||
|
||||
@ -184,6 +182,9 @@ class DashboardTestCase(MgrTestCase):
|
||||
else:
|
||||
assert False
|
||||
try:
|
||||
if not cls._resp.ok:
|
||||
# Output response for easier debugging.
|
||||
log.error("Request response: %s", cls._resp.text)
|
||||
content_type = cls._resp.headers['content-type']
|
||||
if content_type == 'application/json' and cls._resp.text and cls._resp.text != "":
|
||||
return cls._resp.json()
|
||||
|
@ -133,10 +133,10 @@ class Osd(RESTController):
|
||||
:return:
|
||||
"""
|
||||
result = CephService.send_command(
|
||||
'mon', 'osd create', id=svc_id, uuid=uuid)
|
||||
'mon', 'osd create', id=int(svc_id), uuid=uuid)
|
||||
return {
|
||||
'result': result,
|
||||
'svc_id': svc_id,
|
||||
'svc_id': int(svc_id),
|
||||
'uuid': uuid,
|
||||
}
|
||||
|
||||
|
@ -47,8 +47,7 @@ class RequestLoggingTool(cherrypy.Tool):
|
||||
msg = '[DASHBOARD] from=\'{}\' path=\'{}\' method=\'{}\' ' \
|
||||
'user=\'{}\''.format(url, req.path_info, req.method, user)
|
||||
if Settings.AUDIT_API_LOG_PAYLOAD:
|
||||
params = req.params if req.params else {}
|
||||
params.update(get_request_body_params(req))
|
||||
params = dict(req.params or {}, **get_request_body_params(req))
|
||||
# Hide sensitive data like passwords, secret keys, ...
|
||||
# Extend the list of patterns to search for if necessary.
|
||||
# Currently parameters like this are processed:
|
||||
|
Loading…
Reference in New Issue
Block a user