Skip to content

Commit c31fcd8

Browse files
dimon222lresende
authored andcommitted
Fix POST response code API handling (#32)
POST api is responding with response code 202 instead of 200 https://hadoop.apache.org/docs/r2.7.3/hadoop-yarn/hadoop-yarn-site/ResourceManagerRest.html#Cluster_New_Application_API
1 parent 4c0612d commit c31fcd8

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

yarn_api_client/base.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ def request(self, api_path, method='GET', **kwargs):
4444
else:
4545
response = requests.request(method=method, url=api_endpoint, headers=headers, **kwargs)
4646

47-
if response.status_code == requests.codes.ok:
47+
if response.status_code in (200, 202):
4848
return self.response_class(response)
4949
else:
5050
msg = 'Response finished with status: %s. Details: %s' % (response.status_code, response.text)

0 commit comments

Comments
 (0)