Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions tests/test_history_server.py
Original file line number Diff line number Diff line change
Expand Up @@ -77,8 +77,8 @@ def test_task_attempts(self, request_mock):

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

def test_task_attempt_counters(self, request_mock):
self.hs.task_attempt_counters('job_2', 'task_3', 'attempt_4')
request_mock.assert_called_with('/ws/v1/history/mapreduce/jobs/job_2/tasks/task_3/attempt/attempt_4/counters')
request_mock.assert_called_with('/ws/v1/history/mapreduce/jobs/job_2/tasks/task_3/attempts/attempt_4/counters')
2 changes: 1 addition & 1 deletion yarn_api_client/__init__.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# -*- coding: utf-8 -*-
__version__ = '0.2.4'
__version__ = '0.2.5'
__all__ = ['ApplicationMaster', 'HistoryServer', 'NodeManager',
'ResourceManager']

Expand Down
3 changes: 2 additions & 1 deletion yarn_api_client/base.py
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,8 @@ def request(self, api_path, **query_args):
if response.status == OK:
return self.response_class(response)
else:
msg = 'Response finished with status: %s' % response.status
explanation = response.read()
msg = 'Response finished with status: %s. Details: %s' % (response.status, explanation)
raise APIError(msg)

def construct_parameters(self, arguments):
Expand Down
4 changes: 2 additions & 2 deletions yarn_api_client/history_server.py
Original file line number Diff line number Diff line change
Expand Up @@ -216,7 +216,7 @@ def task_attempt(self, job_id, task_id, attempt_id):
:returns: API response object with JSON data
:rtype: :py:class:`yarn_api_client.base.Response`
"""
path = '/ws/v1/history/mapreduce/jobs/{jobid}/tasks/{taskid}/attempt/{attemptid}'.format(
path = '/ws/v1/history/mapreduce/jobs/{jobid}/tasks/{taskid}/attempts/{attemptid}'.format(
jobid=job_id, taskid=task_id, attemptid=attempt_id)

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

return self.request(path)