]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
qa/workunits/rest/test_mgr_rest_api.py: set headers for requests
authorKefu Chai <kchai@redhat.com>
Thu, 15 Jun 2017 02:13:12 +0000 (10:13 +0800)
committerKefu Chai <kchai@redhat.com>
Thu, 15 Jun 2017 02:13:14 +0000 (10:13 +0800)
i think it's a bug in httplib shipped in old distro.

Signed-off-by: Kefu Chai <kchai@redhat.com>
qa/workunits/rest/test_mgr_rest_api.py

index d6a8f534898bb519d21615fa73d043aea7f4c7a7..3dcb1d67741b62870eb45ee453d1011ca49752b7 100755 (executable)
@@ -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)