Skip to content

Commit c7e4700

Browse files
authored
Merge pull request #5 from trams/develop
Fix History REST API
2 parents c98ff96 + c116b69 commit c7e4700

File tree

4 files changed

+7
-6
lines changed

4 files changed

+7
-6
lines changed

tests/test_history_server.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -77,8 +77,8 @@ def test_task_attempts(self, request_mock):
7777

7878
def test_task_attempt(self, request_mock):
7979
self.hs.task_attempt('job_2', 'task_3', 'attempt_4')
80-
request_mock.assert_called_with('/ws/v1/history/mapreduce/jobs/job_2/tasks/task_3/attempt/attempt_4')
80+
request_mock.assert_called_with('/ws/v1/history/mapreduce/jobs/job_2/tasks/task_3/attempts/attempt_4')
8181

8282
def test_task_attempt_counters(self, request_mock):
8383
self.hs.task_attempt_counters('job_2', 'task_3', 'attempt_4')
84-
request_mock.assert_called_with('/ws/v1/history/mapreduce/jobs/job_2/tasks/task_3/attempt/attempt_4/counters')
84+
request_mock.assert_called_with('/ws/v1/history/mapreduce/jobs/job_2/tasks/task_3/attempts/attempt_4/counters')

yarn_api_client/__init__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
# -*- coding: utf-8 -*-
2-
__version__ = '0.2.4'
2+
__version__ = '0.2.5'
33
__all__ = ['ApplicationMaster', 'HistoryServer', 'NodeManager',
44
'ResourceManager']
55

yarn_api_client/base.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,8 @@ def request(self, api_path, **query_args):
3838
if response.status == OK:
3939
return self.response_class(response)
4040
else:
41-
msg = 'Response finished with status: %s' % response.status
41+
explanation = response.read()
42+
msg = 'Response finished with status: %s. Details: %s' % (response.status, explanation)
4243
raise APIError(msg)
4344

4445
def construct_parameters(self, arguments):

yarn_api_client/history_server.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -216,7 +216,7 @@ def task_attempt(self, job_id, task_id, attempt_id):
216216
:returns: API response object with JSON data
217217
:rtype: :py:class:`yarn_api_client.base.Response`
218218
"""
219-
path = '/ws/v1/history/mapreduce/jobs/{jobid}/tasks/{taskid}/attempt/{attemptid}'.format(
219+
path = '/ws/v1/history/mapreduce/jobs/{jobid}/tasks/{taskid}/attempts/{attemptid}'.format(
220220
jobid=job_id, taskid=task_id, attemptid=attempt_id)
221221

222222
return self.request(path)
@@ -232,7 +232,7 @@ def task_attempt_counters(self, job_id, task_id, attempt_id):
232232
:returns: API response object with JSON data
233233
:rtype: :py:class:`yarn_api_client.base.Response`
234234
"""
235-
path = '/ws/v1/history/mapreduce/jobs/{jobid}/tasks/{taskid}/attempt/{attemptid}/counters'.format(
235+
path = '/ws/v1/history/mapreduce/jobs/{jobid}/tasks/{taskid}/attempts/{attemptid}/counters'.format(
236236
jobid=job_id, taskid=task_id, attemptid=attempt_id)
237237

238238
return self.request(path)

0 commit comments

Comments
 (0)