From: Kefu Chai Date: Thu, 15 Jun 2017 02:13:12 +0000 (+0800) Subject: qa/workunits/rest/test_mgr_rest_api.py: set headers for requests X-Git-Tag: v12.1.0~139^2~2 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=8a44b680dd41f45058ec383b376e85c7a900831a;p=ceph.git qa/workunits/rest/test_mgr_rest_api.py: set headers for requests i think it's a bug in httplib shipped in old distro. Signed-off-by: Kefu Chai --- diff --git a/qa/workunits/rest/test_mgr_rest_api.py b/qa/workunits/rest/test_mgr_rest_api.py index d6a8f534898..3dcb1d67741 100755 --- a/qa/workunits/rest/test_mgr_rest_api.py +++ b/qa/workunits/rest/test_mgr_rest_api.py @@ -19,6 +19,7 @@ if len(sys.argv) < 3: addr = sys.argv[1] auth = ('admin', sys.argv[2]) +headers = {'Content-type': 'application/json'} request = None @@ -26,6 +27,7 @@ request = None request = requests.post( addr + '/pool?wait=yes', data=json.dumps({'name': 'supertestfriends', 'pg_num': 128}), + headers=headers, verify=False, auth=auth) print(request.text) @@ -82,6 +84,7 @@ for method, endpoint, args in screenplay: request = getattr(requests, method)( url, data=json.dumps(args), + headers=headers, verify=False, auth=auth) print(request.text)