예제 #1
0
파일: storage.py 프로젝트: suneelb/taskflow
 def _translate_into_history(self, ad):
     failure = None
     if ad.failure is not None:
         # NOTE(harlowja): Try to use our local cache to get a more
         # complete failure object that has a traceback (instead of the
         # one that is saved which will *typically* not have one)...
         cached = self._failures.get(ad.name)
         if ad.failure.matches(cached):
             failure = cached
         else:
             failure = ad.failure
     return retry.History(ad.results, failure=failure)
예제 #2
0
 def _translate_into_history(self, ad):
     failure = None
     if ad.failure is not None:
         # NOTE(harlowja): Try to use our local cache to get a more
         # complete failure object that has a traceback (instead of the
         # one that is saved which will *typically* not have one)...
         failure = ad.failure
         fail_cache = self._failures[ad.name]
         try:
             fail = fail_cache[states.EXECUTE]
             if failure.matches(fail):
                 failure = fail
         except KeyError:
             pass
     return retry.History(ad.results, failure=failure)