diff options
author | Ricardo Marques <rimarques@suse.com> | 2018-10-01 12:47:38 +0200 |
---|---|---|
committer | Ricardo Marques <rimarques@suse.com> | 2018-10-01 12:47:38 +0200 |
commit | 731dcefbeba2affca186d8b5c541ab95e3dedd26 (patch) | |
tree | 6511991e407a87d5c7aa7cfcfc554327a2434246 /qa | |
parent | Merge pull request #24302 from hydro-b/fix-rbd-nbd-docu (diff) | |
download | ceph-731dcefbeba2affca186d8b5c541ab95e3dedd26.tar.xz ceph-731dcefbeba2affca186d8b5c541ab95e3dedd26.zip |
mgr/dashboard: Check content-type before decode json response
Signed-off-by: Ricardo Marques <rimarques@suse.com>
Diffstat (limited to 'qa')
-rw-r--r-- | qa/tasks/mgr/dashboard/helper.py | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/qa/tasks/mgr/dashboard/helper.py b/qa/tasks/mgr/dashboard/helper.py index 025665be4f4..c22ffacfb58 100644 --- a/qa/tasks/mgr/dashboard/helper.py +++ b/qa/tasks/mgr/dashboard/helper.py @@ -169,7 +169,8 @@ class DashboardTestCase(MgrTestCase): else: assert False try: - if cls._resp.text and 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() return cls._resp.text except ValueError as ex: |