[ARVADOS] updated: db79733caa09c2ecaae16c4661a9a38fcf41ef1f
git at public.curoverse.com
git at public.curoverse.com
Wed Oct 7 17:10:34 EDT 2015
Summary of changes:
sdk/python/arvados/__init__.py | 8 ++++++--
sdk/python/tests/test_task_output_retry.py | 3 ++-
2 files changed, 8 insertions(+), 3 deletions(-)
via db79733caa09c2ecaae16c4661a9a38fcf41ef1f (commit)
from 0ef1d324c964f0bbf677e533326b36369ea9e44e (commit)
Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.
commit db79733caa09c2ecaae16c4661a9a38fcf41ef1f
Author: Bryan Cosca <bcosc at curoverse.com>
Date: Wed Oct 7 17:10:28 2015 -0400
6600: Throwing Api errors!
diff --git a/sdk/python/arvados/__init__.py b/sdk/python/arvados/__init__.py
index a319382..9ac0bc8 100644
--- a/sdk/python/arvados/__init__.py
+++ b/sdk/python/arvados/__init__.py
@@ -52,12 +52,16 @@ def task_set_output(self,s,api_client=None,num_retries=5):
'success':True,
'progress':1.0
}).execute()
- except errors.HttpError as error:
+ except errors.ApiError as error:
print "we threw the error"
- if retry.check_http_response_success(error.status_code) is None and tries_left > 0:
+ print dir(error)
+ print error.resp
+ if retry.check_http_response_success(error.resp.status) is None and tries_left > 0: #status_code for HttpError
logger.debug("task_set_output: job_tasks().update() raised {}, retrying with {} tries left".format(repr(error),tries_left))
else:
raise
+ except:
+ print "sup"
_current_task = None
def current_task(api_client=None, num_retries=5):
diff --git a/sdk/python/tests/test_task_output_retry.py b/sdk/python/tests/test_task_output_retry.py
index 4d738cf..4b3af13 100644
--- a/sdk/python/tests/test_task_output_retry.py
+++ b/sdk/python/tests/test_task_output_retry.py
@@ -51,6 +51,7 @@ class ApiClientRetrytestMixin(object):
error_class = self.DEFAULT_EXCEPTION
#print error_class.failureException
#self.run_method(api_client=api_client)
+ print error_class
self.assertRaises(error_class, self.run_method(api_client=api_client), *args, **kwargs)
# def test_immediate_success(self):
@@ -61,7 +62,7 @@ class ApiClientRetrytestMixin(object):
api_client = mock.MagicMock()
# with self.TEST_API_PATCHER(self.DEFAULT_EXPECT, 400), tutil.skip_sleep, \
# self.assertRaises(arvados.errors.HttpError) as err_check:
- with tutil.mock_responses(api_client.job_tasks().update().execute, 400) as req_mock:
+ with tutil.mock_responses('', 500, 400) as req_mock:
print dir(req_mock)
print req_mock
#api_client.job_tasks().update().execute.side_effect = arvados.errors.HttpError(400, "{}")
-----------------------------------------------------------------------
hooks/post-receive
--
More information about the arvados-commits
mailing list